Name
file_put_contents
Synopsis
int file_put_contents(stringpath
, stringstring
[, intflags
[, resourcecontext
]])
Opens the file specified by path
,
writes string to the file, then closes the file. Returns the number
of bytes written to the file, or -1
on error. The flags argument is a
bitfield with two possible values:
| If specified, the include path is searched for the file and the file is written at the first location where the file already exists. |
| If specified and if the file specified by path already exists, string is appended to the existing contents of the file. |
Get Programming PHP, 2nd Edition 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.