1. filename is the name of file or url. 2. include_path if enabled, Search for the file in the include_path as well 3. context this is set of options to modify the behavior of a stream 4. offset this value specifies starting position of file to read. 5. maxlen this value specifies number of bytes to read.

Syntax

PHP file_get_contents() function uses following syntax.

Read File Content to String

This php example script will read content from file and store into string variable.

Read Content from URL to String

This php example script will read content from url and store into string variable.