The is_executable() function checks whether the specified file is executable.
If the file is executable, this function returns TRUE.
is_executable(file)
parameter | describe |
---|---|
file | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
Note: As of PHP version 5.0, the is_executable() function is available for Windows.
<?php$file = "setup.exe";if(is_executable($file)) { echo ("$file is executable"); }else { echo ("$file is not executable"); }?>
The above code will output:
setup.exe is executable