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

WBOY
Release: 2016-06-13 10:11:02
Original
806 people have browsed it

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

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

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

$buf 中就是读出的内容

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

探讨

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

输出的是全部文本内容啊

我是想要这文本内容里的一行。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template