file: incorporate user notes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64297 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
jim winstead 2001-12-08 22:14:24 +00:00
parent 7ff4b44b48
commit 739fedf848

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.96 $ -->
<!-- $Revision: 1.97 $ -->
<reference id="ref.filesystem">
<title>Filesystem functions</title>
<titleabbrev>Filesystem</titleabbrev>
@ -720,6 +720,13 @@ fclose ($fd);
element of the array corresponds to a line in the file, with the
newline still attached.
</para>
<note>
<para>
Each line in the resulting array will include the line ending, so you
still need to use <function>trim</function> if you do not want the line
ending present.
</para>
</note>
<para>
You can use the optional second parameter and set it to "1", if
you want to search for the file in the <link
@ -731,18 +738,20 @@ fclose ($fd);
<![CDATA[
<?php
// get a web page into an array and print it out
$fcontents = file ('http://www.php.net');
$fcontents = file ('http://www.php.net/');
while (list ($line_num, $line) = each ($fcontents)) {
echo "<b>Line $line_num:</b>; " . htmlspecialchars ($line) . "<br>\n";
echo "<b>Line $line_num:</b>; ", htmlspecialchars ($line), "<br>\n";
}
// get a web page into a string
$fcontents = join ('', file ('http://www.php.net'));
$fcontents = join ('', file ('http://www.php.net/'));
?>
]]>
</programlisting>
</informalexample>
</para>
&note.not-bin-safe;
&tip.fopen-wrapper;
<para>
See also <function>readfile</function>,
<function>fopen</function>, <function>fsockopen</function>, and