欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP 讀取文件內(nèi)容代碼(txt,js等)

 更新時(shí)間:2009年12月06日 00:20:58   作者:  
PHP 讀取文件內(nèi)容代碼(txt,js等)
<?php
/*
作者:bjf;
應(yīng)用:讀取文件內(nèi)容;
*/
function read_file_content($FileName)
{
//open file
$fp=fopen($FileName,"r");
$data="";
while(!feof($fp))
{
//read the file
$data.=fread($fp,4096);
}
//close the file
fclose($fp);
//delete the file
//unlink($FileName);
//return the content from the file
echo $data;
}
read_file_content("a.html")
?>
fread與fgets的區(qū)別
fread :以字節(jié)位計(jì)算長度,按照指定的長度和次數(shù)讀取數(shù)據(jù),遇到結(jié)尾或完成指定長度讀取后停止.
fgets :整行讀取,遇到回車換行或結(jié)尾停止.在文本方式時(shí)使用.

相關(guān)文章

最新評(píng)論