array file ( string $path , [ int $flags = 0 ] )

Reads $path into an array.

$flags can be any combination of:

  • FILE_IGNORE_NEW_LINES :Do not add a newline at the end of each array element.
  • FILE_SKIP_EMPTY_LINES : Do not add an empty line to the array.

These contstants are declared by the PHP interpreter itself and are always available.

Returns an array with each element containing a line of the file.

Previous page: file_get_contents
Next page: is_empty