<!DOCTYPE html>
<html>
<body>
<?php
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
$txt = "Bill Gates\n";
fwrite($myfile, $txt);
$txt = "Steve Jobs\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
</body></html>
Como resultado, uma pasta newfile.txt é criada automaticamente na pasta stiterm, e o conteúdo dentro é
Bill Gates
Steve Jobs