Função is_readable() do PHP
❮ Referência do sistema de arquivos PHPExemplo
Verifique se o nome do arquivo especificado é legível:
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
A saída do código acima pode ser:
test.txt is readable
Definição e uso
A função is_readable() verifica se o nome do arquivo especificado é legível.
Nota: O resultado desta função é armazenado em cache. Use clearstatcache() para limpar o cache.
Sintaxe
is_readable(file)
Valores de parâmetro
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Detalhes técnicos
Valor de retorno: | TRUE se o arquivo for legível, FALSE e um E_WARNING caso contrário |
---|---|
Versão do PHP: | 4.0+ |
❮ Referência do sistema de arquivos PHP