View sourcecode

The following files exists in this folder. Click to view.

write_file.php

1 lines ASCII Unix (LF)
1
<?php

$s = "<p>*This awesome message will be saved to a file.*</p>";
echo $s;

echo "Saving file. This function returns the number of bytes that were written to the file, or FALSE on failure. The length of the content is: " . strlen($s) . "<br>";
var_dump(file_put_contents("file.txt", $s));

echo "<br><br>Reading file and output its content.<br>";
$s = file_get_contents("file.txt");
echo $s;