The is_writeable() function checks whether the specified file is writable.
If the file is writable, this function returns TRUE.
This function is an alias of the is_writable() function.
is_writeable(file)
parameter | describe |
---|---|
file | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
<?php$file = "test.txt";if(is_writeable($file)) { echo ("$file is writeable"); }else { echo ("$file is not writeable"); }?>
The above code will output:
test.txt is writeable