Be careful with this example. if gzopen doesn't return a valid handler, gzeof will do a nice loop.
(PHP 4, PHP 5, PHP 7, PHP 8)
gzeof — gz ファイルポインタが EOF かどうか調べる
例1 gzeof() の例
<?php
$gz = gzopen('somefile.gz', 'r');
while (!gzeof($gz)) {
echo gzgetc($gz);
}
gzclose($gz);
?>
Be careful with this example. if gzopen doesn't return a valid handler, gzeof will do a nice loop.