PHP is_writable() º¯Êý
¶¨ÒåºÍÓ÷¨
is_writable() º¯ÊýÅжÏÖ¸¶¨µÄÎļþÊÇ·ñ¿Éд¡£
Óï·¨
is_writable(file)
²ÎÊý | ÃèÊö |
---|---|
file | ±ØÐè¡£¹æ¶¨Òª¼ì²éµÄÎļþ¡£ |
˵Ã÷
Èç¹ûÎļþ´æÔÚ²¢ÇÒ¿ÉдÔò·µ»Ø true¡£file ²ÎÊý¿ÉÒÔÊÇÒ»¸öÔÊÐí½øÐÐÊÇ·ñ¿Éд¼ì²éµÄĿ¼Ãû¡£
ÌáʾºÍ×¢ÊÍ
×¢ÊÍ£º±¾º¯ÊýµÄ½á¹û»á±»»º´æ¡£ÇëʹÓà clearstatcache() À´Çå³ý»º´æ¡£
Àý×Ó
<?php $file = "test.txt"; if(is_writable($file)) { echo ("$file is writeable"); } else { echo ("$file is not writeable"); } ?>
Êä³ö£º
test.txt is writeable