PHP 教程 PHP is_executable() 函数

wheeler · 2022-03-07 12:33:04 · 热度: 19

定义和用法

is_executable() 函数检查指定的文件是否可执行。

如果文件可执行,该函数返回 TRUE。

语法

is_executable(file)

参数 描述
file 必需。规定要检查的文件。

提示和注释

注释:该函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。

注释:PHP 5.0 版本起,is_executable() 函数可用于 Windows。

实例

<?php
$file = "setup.exe";
if(is_executable($file))
{
echo ("$file is executable");
}
else
{
echo ("$file is not executable");
}
?>

上面的代码将输出:

setup.exe is executable

查看更多 PHP Filesystem 函数

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册