Source of: /manual/en/function.gzpassthru.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.zlib.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.gzpassthru.php',
1 => 'gzpassthru',
),
'up' =>
array (
0 => 'ref.zlib.php',
1 => 'Zlib Functions',
),
'prev' =>
array (
0 => 'function.gzopen.php',
1 => 'gzopen',
),
'next' =>
array (
0 => 'function.gzputs.php',
1 => 'gzputs',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<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>
<a name="function.gzpassthru.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><b>gzpassthru</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$zp</tt></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><p><b class="note">Note</b>:
You may need to call <a href="function.gzrewind.php" class="function">gzrewind()</a> to reset the file
pointer to the beginning of the file if you have already written data
to it.
<br />
</p></blockquote>
<div class="tip"><b class="tip">Tip</b>
<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 <a href="function.readgzfile.php" class="function">readgzfile()</a> function, which saves
you the <a href="function.gzopen.php" class="function">gzopen()</a> call.
</p>
</div>
</div>
<a name="function.gzpassthru.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">zp</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The gz-file pointer. It must be valid, and must point to a file
successfully opened by <a href="function.gzopen.php" class="function">gzopen()</a>.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.gzpassthru.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
The number of uncompressed characters read from <i><tt class="parameter">gz</tt></i>
and passed through to the input, or <b><tt class="constant">FALSE</tt></b> on error.
</p>
</div>
<a name="function.gzpassthru.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>gzpassthru()</b> example</b></p>
<div class="example-contents programlisting">
<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>
</p>
</div>
</div><?php manual_footer(); ?>