Home  >  Article  >  Backend Development  >  PHP read file line by line example

PHP read file line by line example

WBOY
WBOYOriginal
2016-07-25 08:53:21826browse
  1. $handle = @fopen("/tmp/inputfile.txt", "r");
  2. if ($handle) {
  3. while (!feof($handle)) {
  4. $buffer = fgets($handle, 4096);
  5. echo $buffer;
  6. }
  7. fclose($handle);
  8. }
  9. ?>
复制代码


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