write_file($path, $data[, $mode = 'wb'])
Parameters:
$path (string) – File path
$data (string) – Data to write to file
$mode (string) – fopen() mode Returns:
TRUE if the write was successful, FALSE in case of an error Return type:
bool
Writes data to the file specified in the path. If the file does not exist then the function will create it.
Example:
$data = 'Some file data';
if ( ! write_file('./path/to/file.php', $data))
{
echo 'Unable to write the file';
}
else
{