This function writes a string to a file.
The Parameter “file” is Required. It Specifies the file to write to. If the file does not exist, this function will create one.
The second Parameter “data” is Required. The data to write to the file. Can be a string, an array or a data stream.
The third Parameter “mode” is Optional.It Specifies how to open/write to the file. Possible values:
The third Parameter “context” is Optional. It Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream.
This function returns the number of character written into the file on success, or FALSE on failure.
echo file_put_contents("test.txt","Php code is executed on the server.");