PHP is_executable () function
Definition and Usage
Are is_executable () function checks the specified executable file.
If an executable file, the function returns TRUE.
grammar
is_executable(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件。 |
Tips and Notes
Note: The results of this function are cached.Use clearstatcache () to clear the cache.
Note: Starting from PHP 5.0 version, is_executable () function can be used in Windows.
Examples
<?php
$file = "setup.exe";
if(is_executable($file))
{
echo ("$file is executable");
}
else
{
echo ("$file is not executable");
}
?>
$file = "setup.exe";
if(is_executable($file))
{
echo ("$file is executable");
}
else
{
echo ("$file is not executable");
}
?>
The code above will output:
setup.exe is executable
Complete PHP Filesystem Reference Manual