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