PHP is_executable() º¯Êý
¶¨ÒåºÍÓ÷¨
is_executable() º¯Êý¼ì²éÖ¸¶¨µÄÎļþÊÇ·ñ¿ÉÖ´ÐС£
Óï·¨
is_executable(file)
| ²ÎÊý | ÃèÊö |
|---|---|
| file | ±ØÐè¡£¹æ¶¨Òª¼ì²éµÄÎļþ¡£ |
˵Ã÷
Èç¹ûÎļþ´æÔÚÇÒ¿ÉÖ´ÐУ¬Ôò·µ»Ø true¡£
ÌáʾºÍ×¢ÊÍ
×¢ÊÍ£º±¾º¯ÊýµÄ½á¹û»á±»»º´æ¡£ÇëʹÓà clearstatcache() À´Çå³ý»º´æ¡£
×¢ÊÍ£ºis_executable() ×Ô PHP 5.0.0 °æÆð¿ÉÓÃÓÚ Windows¡£
Àý×Ó
<?php
$file = "setup.exe";
if(is_executable($file))
{
echo ("$file is executable");
}
else
{
echo ("$file is not executable");
}
?>
Êä³ö£º
setup.exe is executable