在data文件中写入数据: <?php /** * Created by PhpStorm. * User: Administrator * Date: 2015/6/29 * Time: 17:05 */ header("Content-type: text/html; charset=utf-8"); //write data $f = fopen('data','w');//打开文件 fwrite($f,'Hello PHP');//写入数据 fclose($f);//关闭文件 echo 'OK'; //windows环境暂时不考虑权限