fputs

bool fputs(resource file_handle, string data, [int bytes]) 

Writes to a file.

Returns:

TRUE on success; FALSE on error

Description:

fputs() 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). This function is an alias for fwrite() and thus is binary-safe. This means that both binary data (such as an image), and character data can be written with this function.

Note that in the original C libraries fputs() is meant for writing textual data only; thus, using fputs() for binary data is considered bad style.

Warning:

Because some of the filesystem functions to read/write ...

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.