Easy Tutorial
❮ Func Mysqli Get Server Info Pdostatement Debugdumpparams ❯

PHP fputs() Function



Definition and Usage

The fputs() function writes content to an open file.

The function stops running when it reaches the specified length or the end of the file (EOF), whichever comes first.

If the function executes successfully, it returns the number of bytes written. If it fails, it returns FALSE.

The fputs() function is an alias of the fwrite() function.

Syntax

Parameter Description
file Required. Specifies the open file to write to.
string Required. Specifies the string to write to the open file.
length Optional. Specifies the maximum number of bytes to write.

Tips and Notes

Tip: This function is binary-safe. (This means both binary data, such as images, and character data can be written using this function.)


Example

The above code will output:


❮ Func Mysqli Get Server Info Pdostatement Debugdumpparams ❯