<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Write to stream</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-truncate.html">streamWrapper::stream_truncate</a></div> <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div> <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="streamwrapper.stream-write" class="refentry"> <div class="refnamediv"> <h1 class="refname">streamWrapper::stream_write</h1> <p class="verinfo">(PHP 4 >= 4.3.2, PHP 5)</p><p class="refpurpose"><span class="refname">streamWrapper::stream_write</span> — <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="type">int</span> <span class="methodname"><strong>streamWrapper::stream_write</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span> )</div> <p class="para rdfs-comment"> This method is called in response to <span class="function"><a href="function.fwrite.html" 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> <span class="term"><em><code class="parameter">data</code></em></span> <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> </dt> </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>E_WARNING</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 <em><code class="parameter">data</code></em>, <strong><code>E_WARNING</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 class="member"> <span class="function"><a href="function.fwrite.html" class="function" rel="rdfs-seeAlso">fwrite()</a> - Binary-safe file write</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.stream-truncate.html">streamWrapper::stream_truncate</a></div> <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div> <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>