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> 

 

posted @ 2014-12-08 18:15  刘金宇  阅读(1118)  评论(0编辑  收藏  举报