Definition :
The PHP is_executable() function checks whether a file exists and is executable.
Note: The results of this function are cached. Use clearstatcache() function to clear the cache.
is_executable(file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Lets assume that we have a file called demo.txt and setup.exe in the current working directory. The example below demonstrates on using this function to check if these files are executable or not.
Output :
The file demo.txt is not executable.
The file setup.exe is executable.