From c9d8e1779e81b71d115da3bc1b2de1bd24f092d3 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 3 Apr 2007 20:38:29 +0000 Subject: [PATCH] Document the second parameter correctly (user note) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@233199 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/filesystem/functions/file.xml | 52 +++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) 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.