← All built-ins / is_file()
is_file()
is_file(string $s): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | path to test |
Return value
true when the path is an existing regular file.
Example
file_put_contents("/tmp/hphp_doc_f.txt", "x");
var_dump(is_file("/tmp/hphp_doc_f.txt"));
var_dump(is_file("/tmp"));
unlink("/tmp/hphp_doc_f.txt");bool(true) bool(false)