PHP is_executable() 函數
定義和用法
is_executable() 函數檢查指定的文件是否可執行。
語法
is_executable(file)
參數 | 描述 |
---|---|
file | 必需。規定要檢查的文件。 |
說明
如果文件存在且可執行,則返回 true。
實例
<?php $file = "setup.exe"; if(is_executable($file)) { echo ("$file is executable"); } else { echo ("$file is not executable"); } ?>
輸出:
setup.exe is executable