← All built-ins / is_readable()

is_readable()

is_readable(string $s): bool

Parameters

NameTypeDescription
$pathstringpath to test

Return value

true when the file exists and can be read.

Example

file_put_contents("/tmp/hphp_doc_r.txt", "x");
var_dump(is_readable("/tmp/hphp_doc_r.txt"));
unlink("/tmp/hphp_doc_r.txt");
bool(true)

See also

is_writable()file_exists()