<!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>
效果,在stiterm文件夹自动建立了一个newfile.txt文件夹,里面的内容是
Bill Gates
Steve Jobs