
is_executable()函数可以检查指定的文件是否可执行。如果文件是可执行文件,则此函数可以返回true。
语法
bool is_executable ( string $filename )
该函数可以判断文件名是否可执行。
在线示例
<?php
$file = "/PhpProject/setup.exe";
if(is_executable($file)) {
echo $file." is executable";
} else {
echo $file." is not executable";
}
?>
输出结果
/PhpProject/setup.exe is executablePHP Filesystem 参考手册