<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.streamwrapper.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'streamwrapper.stream-read.php',
    1 => 'streamWrapper::stream_read',
    2 => 'Read from stream',
  ),
  'up' => 
  array (
    0 => 'class.streamwrapper.php',
    1 => 'streamWrapper',
  ),
  'prev' => 
  array (
    0 => 'streamwrapper.stream-open.php',
    1 => 'streamWrapper::stream_open',
  ),
  'next' => 
  array (
    0 => 'streamwrapper.stream-seek.php',
    1 => 'streamWrapper::stream_seek',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/streamwrapper/stream-read.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="streamwrapper.stream-read" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_read</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_read</span> &mdash; <span class="dc-title">Read from stream</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-read-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>streamWrapper::stream_read</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$count</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   This method is called in response to <span class="function"><a href="function.fread.php" class="function">fread()</a></span>
   and <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span>.
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Remember to update the read/write position of the stream (by the number of
    bytes that were successfully read).
   </p>
  </p></blockquote>

 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-read-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">count</code></dt>
     <dd>
      <p class="para">
       How many bytes of data from the current position should be returned.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-read-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   If there are less than <code class="parameter">count</code>
   bytes available, as many as are available should be returned.
   If no more data is available, an empty string should be returned.
   To signal that reading failed, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> should be returned.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.stream-read-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="para">Wirft
<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>, wenn der Aufruf dieser Methode
fehlschlug (z. B. weil sie nicht implementiert ist).</p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    If the return value is longer then <code class="parameter">count</code> an
    <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> error will be emitted, and excess data will be
    lost.
   </p>
  </p></blockquote>
 </div>

 



 <div class="refsect1 notes" id="refsect1-streamwrapper.stream-read-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    <span class="methodname"><a href="streamwrapper.stream-eof.php" class="methodname">streamWrapper::stream_eof()</a></span> is called directly after
    calling <span class="methodname"><strong>streamWrapper::stream_read()</strong></span> to check if
    <abbr title="End Of File">EOF</abbr> has been reached. If not implemented,
    <abbr title="End Of File">EOF</abbr> is assumed.
   </p>
  </p></blockquote>
  <div class="warning"><strong class="warning">Warnung</strong>
    <p class="para">
      When reading the whole file (for example, with
      <span class="function"><a href="function.file-get-contents.php" class="function">file_get_contents()</a></span>), PHP will call
      <span class="methodname"><strong>streamWrapper::stream_read()</strong></span> followed by        
      <span class="methodname"><a href="streamwrapper.stream-eof.php" class="methodname">streamWrapper::stream_eof()</a></span> in a loop but as long    
      as <span class="methodname"><strong>streamWrapper::stream_read()</strong></span> returns a
      non-empty string, the return value of
      <span class="methodname"><a href="streamwrapper.stream-eof.php" class="methodname">streamWrapper::stream_eof()</a></span> is ignored.
    </p>
  </div>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-read-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fread.php" class="function" rel="rdfs-seeAlso">fread()</a> - Liest Bin&auml;rdaten aus einer Datei</span></li>
    <li><span class="function"><a href="function.fgets.php" class="function" rel="rdfs-seeAlso">fgets()</a> - Liest die Zeile von der Position des Dateizeigers</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>