CakeFest 2024: The Official CakePHP Conference

gzeof

(PHP 4, PHP 5, PHP 7, PHP 8)

gzeofGzipli dosya tanıtıcında dosya sonunu sınar

Açıklama

gzeof(resource $dt): bool

Gzipli dosya tanıtıcısında dosya sonuna gelinmişse true döndürür.

Bağımsız Değişkenler

dt

Gzipli dosya tanıtıcısı. gzopen() tarafından açılmış bir dosyayı gösteren geçerli bir tanıtıcı olmalıdır.

Dönen Değerler

Gzipli dosya tanıtıcısında dosya sonuna gelinmişse veya bir hata oluşmuşsa true aksi takdirde false döndürür.

Örnekler

Örnek 1 - gzeof() örneği

<?php
$gz
= gzopen('birdosya.gz', 'r');
while (!
gzeof($gz)) {
echo
gzgetc($gz);
}
gzclose($gz);
?>

add a note

User Contributed Notes 2 notes

up
5
thomas at poindessous dot com
16 years ago
Be careful with this example. if gzopen doesn't return a valid handler, gzeof will do a nice loop.
up
-1
Anonymous
10 years ago
<?php
#fixed example
$gz = gzopen('somefile.gz', 'r');
while (
$gz && !gzeof($gz)) {
echo
gzgetc($gz);
}
gzclose($gz);
?>
To Top