<!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>Output all remaining data on a gz-file pointer</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gzopen.html">gzopen</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.gzputs.html">gzputs</a></div> <div class="up"><a href="ref.zlib.html">Zlib Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.gzpassthru" class="refentry"> <div class="refnamediv"> <h1 class="refname">gzpassthru</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">gzpassthru</span> — <span class="dc-title"> Output all remaining data on a gz-file pointer </span></p> </div> <div class="refsect1 description" id="refsect1-function.gzpassthru-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><strong>gzpassthru</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$zp</code></span> )</div> <p class="para rdfs-comment"> Reads to <acronym title="End Of File">EOF</acronym> on the given gz-file pointer from the current position and writes the (uncompressed) results to standard output. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> You may need to call <span class="function"><a href="function.gzrewind.html" class="function">gzrewind()</a></span> to reset the file pointer to the beginning of the file if you have already written data to it. </p> </p></blockquote> <div class="tip"><strong class="tip">Tip</strong> <p class="para"> If you just want to dump the contents of a file to the output buffer, without first modifying it or seeking to a particular offset, you may want to use the <span class="function"><a href="function.readgzfile.html" class="function">readgzfile()</a></span> function, which saves you the <span class="function"><a href="function.gzopen.html" class="function">gzopen()</a></span> call. </p> </div> </div> <div class="refsect1 parameters" id="refsect1-function.gzpassthru-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">zp</code></em></span> <dd> <p class="para"> The gz-file pointer. It must be valid, and must point to a file successfully opened by <span class="function"><a href="function.gzopen.html" class="function">gzopen()</a></span>. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.gzpassthru-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> The number of uncompressed characters read from <em><code class="parameter">gz</code></em> and passed through to the input, or <strong><code>FALSE</code></strong> on error. </p> </div> <div class="refsect1 examples" id="refsect1-function.gzpassthru-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-822"> <p><strong>Example #1 <span class="function"><strong>gzpassthru()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">gzopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'file.gz'</span><span style="color: #007700">, </span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">gzpassthru</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">gzclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gzopen.html">gzopen</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.gzputs.html">gzputs</a></div> <div class="up"><a href="ref.zlib.html">Zlib Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>