fleshed out SplFileObject::fread() a bit

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334795 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Peter Cowburn 2014-09-06 18:54:10 +00:00
parent eba5461de9
commit 340b340721

View file

@ -35,9 +35,50 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The string read from the file.
Returns the string read from the file &return.falseforfailure;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example xml:id="splfileobject.fread.examples.basic">
<title><methodname>SplFileObject::fread</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Get contents of a file into a string
$filename = "/usr/local/something.txt";
$file = new SplFileObject($filename, "r");
$contents = $file->fread($file->getSize());
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Note that <methodname>SplFileObject::fread</methodname> reads from the current
position of the file pointer. Use <methodname>SplFileObject::ftell</methodname>
to find the current position of the pointer and <methodname>SplFileObject::rewind</methodname>
(or <methodname>SplFileObject::fseek</methodname>) to rewind the pointer position.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>fread</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file