file

file -- read entire file into an array

Description

array file(string filename, int [use_include_path]);

Identical to readfile(), except that file() returns the file in an array. Each element of the array corresponds to a line in the file, with the newline still attached.

You can use the optional second parameter and set it to "1", if you want to search for the file in the include_path, too.

See also readfile(), fopen(), and popen().