note 112288 modified in splfileobject.fgets by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 Jun 2013 17:43:41 +0000 |
| Subject: | note 112288 modified in splfileobject.fgets by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195067@lists.php.net to get a copy of this message | ||
fgets don't skip empty lines if SplFileObject::SKIP_EMPTY is enabled.
Instead use
<?php
while (!$file->eof()) {
$file->next();
echo $file->current();
}
?>
--was--
fgets don't skip empty lines if SplFileObject::SKIP_EMPTY is enabled.
Instead use
while (!$file->eof()) {
$file->next();
echo $file->current();
}
http://php.net/manual/en/splfileobject.fgets.php