English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
A função is_writable() pode verificar se o arquivo especificado é gravável. Se o arquivo for gravável, esta função pode retornar true.
bool is_writable ( string $filename )
Se o nome do arquivo existir e for gravável, esta função pode retornar true. O parâmetro filename pode ser um nome de diretório, o que nos permite verificar se o diretório é gravável também.
<?php $file = "/PhpProject/php/phptest.txt"; if(is_writable($file)) { echo ("$file is writable"); } else { echo ("$file is not writable"); } ?>
Resultado de saída
/PhpProject/php/phptest.txt é gravávelPHP Filesystem Referência Manual