mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
Added note about fread() on windows..
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@42830 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
90253a7e38
commit
3d1e9eb684
1 changed files with 25 additions and 4 deletions
|
@ -1134,10 +1134,14 @@ $fcontents = join ('', file ('http://www.php.net'));
|
|||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
The <parameter>mode</parameter> may contain the letter
|
||||
'b'. This is useful only on systems which differentiate between
|
||||
binary and text files (i.e., it's useless on Unix). If not
|
||||
needed, this will be ignored.
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
The <parameter>mode</parameter> may contain the letter
|
||||
'b'. This is useful only on systems which differentiate between
|
||||
binary and text files (i.e. Windows. It's useless on Unix).
|
||||
If not needed, this will be ignored.
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
You can use the optional third parameter and set it to "1", if
|
||||
|
@ -1278,6 +1282,23 @@ $fp = fopen ("c:\\data\\info.txt", "r");
|
|||
$filename = "/usr/local/something.txt";
|
||||
$fd = fopen ($filename, "r");
|
||||
$contents = fread ($fd, filesize ($filename));
|
||||
fclose ($fd);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
On systems which differentiate between binary and text files
|
||||
(i.e. Windows) the file must be opened with 'b' included in
|
||||
<function>fopen</function> mode parameter.
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
$filename = "c:\\files\\somepic.gif";
|
||||
$fd = fopen ($filename, "rb");
|
||||
$contents = fread ($fd, filesize ($filename));
|
||||
fclose ($fd);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
|
Loading…
Reference in a new issue