$file_path="a.php";//file$file_arr=file($file_path);if(file_exists($file_path)){$file_arr=file($file_path);for($i=0;$i
",$str);fclose($fp);}if(file_exists($file_path)){$fp=fopen($file_path,"r");$str="";$buffer=1024;//每次读取1024字节while(!feof($fp)){//循环读取,直到读取整个文件$str.=fread($fp,$buffer);}$str=str_replace("\r\n","
",$str);回声$海峡;fclose($fp);}//file_get_contentsif(file_exists($file_path)){$str=file_get_contents($file_path);}//fgetsif(file_exists($file_path)){$fp=fopen($file_path,"r");$str="";while(!feof($fp)){$str.=fgets($fp);//逐行读取如果fgets不写length参数,默认读取1k。}$str=str_replace("\r\n","
",$str);回声$海峡;fclose($fp);}
