<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'streamwrapper.stream-write.php',
    1 => 'streamWrapper::stream_write',
    2 => 'Write to stream',
  ),
  'up' => 
  array (
    0 => 'class.streamwrapper.php',
    1 => 'streamWrapper',
  ),
  'prev' => 
  array (
    0 => 'streamwrapper.stream-truncate.php',
    1 => 'streamWrapper::stream_truncate',
  ),
  'next' => 
  array (
    0 => 'streamwrapper.unlink.php',
    1 => 'streamWrapper::unlink',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/streamwrapper/stream-write.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="streamwrapper.stream-write" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::stream_write</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_write</span> &mdash; <span class="dc-title">Write to stream</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.stream-write-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>streamWrapper::stream_write</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   This method is called in response to <span class="function"><a href="function.fwrite.php" class="function">fwrite()</a></span>.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Remember to update the current position of the stream by number of bytes
    that were successfully written.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.stream-write-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       Should be stored into the underlying stream.
      </p>
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        If there is not enough room in the underlying stream, store as much as
        possible.
       </p>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.stream-write-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Should return the number of bytes that were successfully stored, or 0 if
   none could be stored.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.stream-write-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">Emits
<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> if call to this method fails
(i.e. not implemented).</p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    If the return value is greater the length of
    <code class="parameter">data</code>, <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> will be
    emitted and the return value will truncated to its length.
   </p>
  </p></blockquote>
 </div>

 



 <div class="refsect1 seealso" id="refsect1-streamwrapper.stream-write-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fwrite.php" class="function" rel="rdfs-seeAlso">fwrite()</a> - Binary-safe file write</span></li>
   </ul>
  </p>
 </div>


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