← All built-ins / is_readable()
is_readable()
is_readable(string $s): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | path 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)