
is_writeable()函数可以检查指定的文件是否可写。如果文件是可写的,则此函数可以返回true。它是is_writable()函数的别名。
语法
bool is_writeable ( string $filename )
在线示例
<?php
$file = "/PhpProject/php/phptest.txt";
if(is_writeable($file)) {
echo ("$file 是可写的");
} else {
echo ("$file 是不可写的");
}
?>输出结果
/PhpProject/php/phptest.txt 是可写的