Predefined function reference

file_put_contents

A reference entry for file_put_contents

Predefined function · file

file_put_contents (string file[, boolean append], string contents1[, string contents2, string contents3, ..., string contentsN]) ⇒ string

Writes an infinite amount of parameters to a text file. You can append text on the end by inserting the boolean append before writing the file. Note, if you do choose to do this and wish to write a boolean true or false value to the file, the preferred option is that you should use file_write("filename.txt", "", true) as the second parameter will not be recognised as append boolean.

Notes

If you choose to do append and wish to write a boolean true or false value to the file, the suggestion is that you should use file_put_contents("filename.txt", "", true) as the second parameter will not be recognised as append boolean this way.