Check whether the specified filename is writable:
<?php
$file = "test.txt";
if(is_writable($file)) {
echo ("$file is writable");
} else {
echo ("$file is not writable");
}
?>
The output of the code above could be:
test.txt is writable
The is_writable() function checks whether the specified filename is writable.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
is_writable(
file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Return Value: | TRUE if the file is writable, an E_WARNING on failure |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!