← All built-ins / file_get_contents()
file_get_contents()
file_get_contents(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | file path |
Return value
The whole file as a string; throws when the file cannot be opened.
Example
file_put_contents("/tmp/hphp_doc_demo.txt", "holy contents");
echo file_get_contents("/tmp/hphp_doc_demo.txt");holy contents