is_writeable()函數(shù)可以檢查指定的文件是否可寫。如果文件是可寫的,則此函數(shù)可以返回true。它是is_writable()函數(shù)的別名。
bool is_writeable ( string $filename )
<?php
$file = "/PhpProject/php/phptest.txt";
if(is_writeable($file)) {
echo ("$file 是可寫的");
} else {
echo ("$file 是不可寫的");
}
?>輸出結(jié)果
/PhpProject/php/phptest.txt 是可寫的