1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 网站技术 - php - 正文

君子好学,自强不息!

实例说明:

<?php
$file = fopen("test.txt", "r");
//Output a line of the file until the end is reached
while(! feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);
?>

标签含义:

feof() 函数检查是否已到达文件末尾(EOF)。

如果出错或者文件指针到了文件末尾(EOF)则返回 TRUE,否则返回 FALSE。

源代码运行结果如下:

Hello, this is a test file.
There are three lines here.
This is the last line.


本文来源:1818IP

本文地址:https://www.1818ip.com/post/330.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。