← All built-ins / is_writable()
is_writable()
is_writable(string $s): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | path to test |
Return value
true when the file exists and can be written.
Example
file_put_contents("/tmp/hphp_doc_w.txt", "x");
var_dump(is_writable("/tmp/hphp_doc_w.txt"));
unlink("/tmp/hphp_doc_w.txt");bool(true)