I’ve placed an echo before and after it stops running. The file file1.txt is written, but then the final echo confirmation is not returned.
<?php
$fh = fopen("file1.txt", 'w') or die("Failed to create file");
$text = <<<_END
Line 1
Line 2
Line 3
_END;
fwrite($fh, $text) or die("Could not write to file");
echo "This shows up in my browser";
$fclose($fh);
echo "This doesn't";
?>
Your script has error
Replace
With
To see all the error add this to the top of your page
Since you are learning if you want to play around with variable functions this would work
Finally a simpler version of your code for learning purpose using
file_put_contentshttp://php.net/manual/en/function.file-put-contents.php