php读取外部txt文件内容并打印在页面|fopen()函数
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <?php $f = fopen('101010100.json','r'); $ln= 0; while (! feof ($f)) { $line= fgets ($f); ++$ln; if ($line===FALSE) print ("FALSE\n"); else print ($line."<br />"); } fclose ($f); ?> </body> </html>