PHP file_exists() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Controleer of een bestand bestaat:
<?php
echo file_exists("test.txt");
?>
Definitie en gebruik
De functie file_exists() controleert of een bestand of directory bestaat.
Opmerking: het resultaat van deze functie wordt in de cache opgeslagen. Gebruik clearstatcache() om de cache te wissen.
Syntaxis
file_exists(path)
Parameterwaarden
Parameter | Description |
---|---|
path | Required. Specifies the path to the file or directory to check |
Technische details
Winstwaarde: | TRUE als het bestand of de directory bestaat, FALSE bij fout |
---|---|
PHP-versie: | 4.0+ |
❮ Referentie voor PHP-bestandssysteem