您的位置:首页 > 编程语言 > PHP开发

php读取外部txt文件内容并打印在页面|fopen()函数

2014-12-08 18:15 876 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: