PHP is_readable() İşlevi
❮ PHP Dosya Sistemi ReferansıÖrnek
Belirtilen dosya adının okunabilir olup olmadığını kontrol edin:
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
Yukarıdaki kodun çıktısı şöyle olabilir:
test.txt is readable
Tanım ve Kullanım
is_readable() işlevi, belirtilen dosya adının okunabilir olup olmadığını kontrol eder.
Not: Bu işlevin sonucu önbelleğe alınır. Önbelleği temizlemek için clearstatcache() kullanın .
Sözdizimi
is_readable(file)
Parametre Değerleri
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Teknik detaylar
Geri dönüş değeri: | Dosya okunabilirse DOĞRU, YANLIŞ ve aksi takdirde E_WARNING |
---|---|
PHP Sürümü: | 4.0+ |
❮ PHP Dosya Sistemi Referansı