The following describes whether the is_writable file can be read and written.
The following describes whether the is_writable file can be read and written.
Is_writable
(PHP 4 and PHP 5)
Is_writable-tell whether filename is written
Description
Boolean is_writable (string $ file name)
Returns TRUE if the object exists and can be written. This file name parameter may be a directory name that allows you to check if it is a writable directory.
Remember that the PHP Web server that can access the file's user ID runs (usually 'who '). The limitation of the security mode is not taken into account.
Parameters
File Name
The file name being checked.
Return Value
Returns TRUE if the object exists and can be written.
Instance
Example of #1 is_writable ()
$ Filename = 'test.txt ';
If (is_writable ($ filename )){
Echo 'The file is writable ';
} Else {
Echo 'The file is not writable ';
}
?>