Category Archives: PHP-file_put_contents()


The file_put_contents() filesystem function in PHP will write string data to a file. It works the same as if you were to use fopen(), fwrite(), and fclose() together to write data to a file. The file will be created if the output file does not exist yet, and if it already exists it will be overwritten.
Here is the Example

file testing
If you would like to append to existing data in a file that already exists you can use the third parameter for this function.

file testing ,this content is for appendng.