← All built-ins / touch()
touch()
touch(string $s): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | file path |
Return value
true; creates the file when missing.
Example
touch("/tmp/hphp_doc_t.txt");
var_dump(file_exists("/tmp/hphp_doc_t.txt"));
unlink("/tmp/hphp_doc_t.txt");bool(true)