cvs: phpdoc /en/reference/filesystem/functions file.xml

From: Date: Tue, 03 Apr 2007 20:38:30 +0000
Subject: cvs: phpdoc /en/reference/filesystem/functions file.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969375976@lists.php.net to get a copy of this message
bjori Tue Apr 3 20:38:30 2007 UTC Modified files: /phpdoc/en/reference/filesystem/functions file.xml Log: Document the second parameter correctly (user note) http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/file.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc/en/reference/filesystem/functions/file.xml diff -u phpdoc/en/reference/filesystem/functions/file.xml:1.20 phpdoc/en/reference/filesystem/functions/file.xml:1.21 --- phpdoc/en/reference/filesystem/functions/file.xml:1.20 Sat Feb 3 08:13:44 2007 +++ phpdoc/en/reference/filesystem/functions/file.xml Tue Apr 3 20:38:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> +<!-- $Revision: 1.21 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.file"> <refnamediv> @@ -11,21 +11,59 @@ <methodsynopsis> <type>array</type><methodname>file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> - Identical to <function>file_get_contents</function>, except that + Similiar to <function>file_get_contents</function>, except that <function>file</function> 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, <function>file</function> returns &false;. </para> <para> - You can use the optional <parameter>use_include_path</parameter> parameter - and set it to "1", if you want to search for the file in the <link - linkend="ini.include-path">include_path</link>, too. + The optional parameter <parameter>flags</parameter> can be one, or more, of + the following constants: + <variablelist> + <varlistentry> + <term> + <constant>FILE_USE_INCLUDE_PATH</constant> + </term> + <listitem> + <simpara> + Search for the file in the <link linkend="ini.include-path">include_path</link>. + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> + <constant>FILE_IGNORE_NEW_LINES</constant> + </term> + <listitem> + <simpara> + Do not add newline at the end of each array element + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> + <constant>FILE_SKIP_EMPTY_LINES</constant> + </term> + <listitem> + <simpara> + Skip empty lines + </simpara> + </listitem> + </varlistentry> + </variablelist> </para> + <note> + <para> + Prior to PHP 5.0.0 the <parameter>flags</parameter> parameter only + covered <link linkend="ini.include-path">include_path</link> and was + enabled with 1. + </para> + </note> <para> <informalexample> <programlisting role="php"> @@ -50,7 +88,7 @@ &tip.fopen-wrapper; <note> <para> - 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 <function>rtrim</function> if you do not want the line ending present. </para>

« previous php.doc (#969375976) next »