20191114PHP文件操作

 

<meta charset="utf-8">
<?php
// $fn=fopen("c:\\abc.txt","w");

// fwrite($fn,"hello world");

// fclose($fn);

// $fn=fopen("c:\\news.txt","r");

// while(!feof($fn)){
// $str=fgets($fn);
// echo $str."<br />";
// }

// fclose($fn);


// $fn=fopen("http://www.baidu.com","r");
// while($str=fread($fn,8000)){
// echo $str;
// }
// fclose($fn);


// echo file_get_contents("c:\\news.txt");
// file_put_contents("c:\\abc.txt","我是来自重庆的学生");

// $n=file_get_contents("c:\\count.txt");
// $n++;
// echo "您是第".$n."位访客";
// file_put_contents("c:\\count.txt",$n);

 

posted @ 2019-11-14 20:25  深夜起来玩游戏  阅读(73)  评论(0)    收藏  举报