Object function reference

read

A reference entry for read

Object function · File

read() ⇒ string

Provides the read operation for this object.

Example

YASS
$contents = $file->read()
print($contents)

Notes

This corresponds to the historical file_get_contents operation. Text can also be read from a URL where supported.