PHP 處理TXT文件(打開/關閉/檢查/讀取)_PHP教程
推薦:PHP處理excel cvs表格的方法實例介紹PHP處理excel cvs表格想必有很多朋友對此還是很陌生的吧,下面以實例為大家介紹下,感興趣的朋友可以參考下哈,希望對你有所幫助
php文件處理:復制代碼 代碼如下:www.wf0088.com
<?php
$filename=dirname(__FILE__)."/readfrom.txt";
$ofilename=dirname(__FILE__)."/writeto.txt";
if(!file_exists($filename)){
echo $filename." not found!";
exit;
}
$fp=fopen($filename,"r");
$fo = fopen($ofilename,"w");
while(!feof($fp)){
$record=fgets($fp);
if($record!=NULL){
$record_arr=explode("\t", $record);
fwrite($fo,$record,strlen($col));
}
}
fclose($fo);
fclose($fp);
?>
分享:基于php實現(xiàn)長連接的方法與注意事項的問題本篇文章是對在php中實現(xiàn)長連接的方法與注意事項的問題進行了詳細的分析介紹。需要的朋友參考下
相關PHP教程:
- 相關鏈接:
- 教程說明:
PHP教程-PHP 處理TXT文件(打開/關閉/檢查/讀取)。