# dio_write

(PHP 4 >= 4.2.0, PHP 5 <= 5.0.5)

dio_write — Writes data to fd with optional truncation at length

### Description

int dio_write ( resource `$fd` , string `$data` [, int `$len` ] )

dio_write() writes up to `len` bytes from `data` to file `fd` .

### Parameters

`fd`

  The file descriptor returned by dio_open().

`data`

  The written data.

`len`

  The length of data to write in bytes. If not specified, the function writes all the data to the specified file.

### Return Values

Returns the number of bytes written to `fd` .

### See Also

- dio_read()