PHP is_readable() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Controleer of de opgegeven bestandsnaam leesbaar is:
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
De uitvoer van de bovenstaande code zou kunnen zijn:
test.txt is readable
Definitie en gebruik
De functie is_readable() controleert of de opgegeven bestandsnaam leesbaar is.
Opmerking: het resultaat van deze functie wordt in de cache opgeslagen. Gebruik clearstatcache() om de cache te wissen.
Syntaxis
is_readable(file)
Parameterwaarden
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Technische details
Winstwaarde: | TRUE als het bestand leesbaar is, FALSE en anders een E_WARNING |
---|---|
PHP-versie: | 4.0+ |
❮ Referentie voor PHP-bestandssysteem