Added short examples to file().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@18826 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Torben Wilson 2000-01-26 20:43:34 +00:00
parent 61c85ff417
commit 78f7996190

View file

@ -537,6 +537,7 @@ fclose ($fd);
</refsect1>
</refentry>
<refentry id="function.file">
<refnamediv>
<refname>file</refname>
@ -551,17 +552,34 @@ fclose ($fd);
<parameter><optional>use_include_path</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
Identical to <function>readfile</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.
</para>
<para>
You can use the optional second 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.
</para>
<para>
<informalexample>
<programlisting>
&lt;?php
// get a web page into an array
$fcontents = file( 'http://www.php.net' );
// get a web page into a string
$fcontents = join( '', file( 'http://www.php.net' ) );
?&gt;
</programlisting>
</informalexample>
</para>
<para>
See also <function>readfile</function>,
<function>fopen</function>, and <function>popen</function>.
@ -569,6 +587,7 @@ fclose ($fd);
</refsect1>
</refentry>
<refentry id="function.file-exists">
<refnamediv>
<refname>file_exists</refname>