fwrite

string fwrite(resource file_handle, string data, [int bytes]) 

Writes data to a file.

Returns:

TRUE on success; FALSE on failure

Description:

fwrite() writes the data given in data to the specified file. The optional bytes argument denotes the maximum number of bytes to be written to the file (useful if you don’t want to dump all of the data contained in the data string). If you’re using the bytes parameter, the configuration value of "magic_quotes_runtime" is ignored and no slashes are stripped from data . This function is binary-safe, so binary data (such as an image) can be written as well as text.

Warning:

Because some of the filesystem functions to read/write from files partially share the same code, one or more of the bugs reported ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.