mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
61c85ff417
commit
78f7996190
1 changed files with 19 additions and 0 deletions
|
@ -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>
|
||||
<?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' ) );
|
||||
?>
|
||||
</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>
|
||||
|
|
Loading…
Reference in a new issue