is_writable
is_writable
Tells whether the filename is writable
bool **is_writable** string $filename
Returns true if the exists and is
writable. The filename argument may be a directory name allowing you
to check if a directory is writable.
filename
Keep in mind that PHP may be accessing the file as the user id that the web server runs as (often 'nobody').
filenameThe filename being checked.
Returns true if the exists and is
writable.
filename
Voorbeeld: example
<?php
$filename = 'test.txt';
if (is_writable($filename)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
?>
is_readable``file_exists``fwrite