Created
December 31, 2017 02:32
-
-
Save phpfiddle/a3d07a6e047a2ed77319b1d8c0b295de to your computer and use it in GitHub Desktop.
[ Posted by Jonathan Klemm ] Example 7-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // testfile.php | |
$fh = fopen("testfile.txt", 'w') or die("Failed to create a file"); | |
$text = <<<_END | |
Line 1 | |
Line 2 | |
Line 3 | |
_END; | |
fwrite($fh, $text) or die("Could not write to file"); | |
fclose($fh); | |
echo "File 'testfile.txt' written successfully"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment