Home  >  Article  >  Backend Development  >  PHP 读取大文件时,怎样得到以回车换行的一行数据。该怎么解决

PHP 读取大文件时,怎样得到以回车换行的一行数据。该怎么解决

WBOY
WBOYOriginal
2016-06-13 13:45:15854browse

PHP 读取大文件时,怎样得到以回车换行的一行数据。
PHP 读取大文件时,怎样得到以回车换行的一行数据。??

------解决方案--------------------
/r/n你说的是不是这样啊
------解决方案--------------------
看php手册

fgets ― 从文件指针中读取一行
------解决方案--------------------
$buf = fgets($fp);

$buf 中就是读出的内容

不知道你想要什么
------解决方案--------------------

探讨

$buf = fgets($fp);
echo $buf;

输出的是全部文本内容啊

我是想要这文本内容里的一行。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn