diff --git a/reference/filesystem/functions/file.xml b/reference/filesystem/functions/file.xml index 015da0452e..7887c233d4 100644 --- a/reference/filesystem/functions/file.xml +++ b/reference/filesystem/functions/file.xml @@ -1,5 +1,5 @@ - + @@ -11,21 +11,59 @@ arrayfile stringfilename - intuse_include_path + intflags resourcecontext - Identical to file_get_contents, except that + Similiar to file_get_contents, 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. Upon failure, file returns &false;. - You can use the optional use_include_path parameter - and set it to "1", if you want to search for the file in the include_path, too. + The optional parameter flags can be one, or more, of + the following constants: + + + + FILE_USE_INCLUDE_PATH + + + + Search for the file in the include_path. + + + + + + FILE_IGNORE_NEW_LINES + + + + Do not add newline at the end of each array element + + + + + + FILE_SKIP_EMPTY_LINES + + + + Skip empty lines + + + + + + + Prior to PHP 5.0.0 the flags parameter only + covered include_path and was + enabled with 1. + + @@ -50,7 +88,7 @@ $html = implode('', file('http://www.example.com/')); &tip.fopen-wrapper; - Each line in the resulting array will include the line ending, so you + Each line in the resulting array will include the line ending, unless FILE_IGNORE_NEW_LINES is used, so you still need to use rtrim if you do not want the line ending present.