PHP Manual
Prev |  | Next

# fwrite

fwrite -- Binary-safe file write

## Description

`int fwrite`(int fp, string string, int [length]);

fwrite() writes the contents of `string` to the file stream pointed to by `fp`. If the `length` argument is given, writing will stop after `length` bytes have been written or the end of `string` is reached, whichever comes first.

Note that if the `length` argument is given, then the magic_quotes_runtime configuration option will be ignored and no slashes will be stripped from `string`.

See also fread(), fopen(), fsockopen(), popen(), and fputs().

Prev | Home | Next
ftell | Up | set_file_buffer