The is_writable() function checks whether the specified file is writable.
If the file is writable, this function returns TRUE.
is_writable(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_writable($file)) { echo ("$file is writeable"); }else { echo ("$file is not writeable"); }?>
The above code will output:
test.txt is writeable