PHP逐行读取文件范例代码,通过fopen打开文件,fgets读取文件,fclose关闭文件
/**
* PHP逐行读取文件范例代码
*
* @param
* @arrange 512-笔记网: 512Pic.com
**/
<?PHP
$file = fopen("welcome.txt","r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);
?>
/*** 来自编程之家 jb51.cc(jb51.cc) ***/