mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
eba5461de9
commit
340b340721
1 changed files with 42 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue