Php/func filesystem is executable
来自菜鸟教程
PHP is_executable()函数
例
检查指定的文件名是否可执行:
<?php
$file = "setup.exe";
if(is_executable($file)) {
echo ("$file is executable");
}
else {
echo ("$file is not executable");
}
?>
上面代码的输出可能是:
setup.exe is executable
定义和用法
is_executable()函数检查指定的文件名是否可执行。
注意: 此功能的结果被缓存。Use clearstatcache()
清除缓存。
句法
is_executable(file)
参数值
| 参数 | 描述 |
|---|---|
| file | 需要。指定要检查的文件的路径 |
技术细节
| 返回值: | 如果文件是可执行文件,则为TRUE,否则为FALSE并在失败时显示E_WARNING |
| PHP版本: | 4.0+ |