Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 13075

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>Returns the entry contents using its index</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ziparchive.getcommentname.html">ZipArchive::getCommentName</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ziparchive.getfromname.html">ZipArchive::getFromName</a></div>
 <div class="up"><a href="class.ziparchive.html">ZipArchive</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="ziparchive.getfromindex" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZipArchive::getFromIndex</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PECL zip &gt;= 1.3.0)</p><p class="refpurpose"><span class="refname">ZipArchive::getFromIndex</span> &mdash; <span class="dc-title">Returns the entry contents using its index</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-ziparchive.getfromindex-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>ZipArchive::getFromIndex</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$length</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
  ]] )</div>

  <p class="para rdfs-comment">
   Returns the entry contents using its index.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-ziparchive.getfromindex-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">index</code></em></span>
     <dd>

      <p class="para">
       Index of the entry
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">length</code></em></span>
     <dd>

      <p class="para">
       The length to be read from the entry. If <em>0</em>, then the
       entire entry is read.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">flags</code></em></span>
     <dd>

      <p class="para">
       The flags to use to open the archive. the following values may
       be ORed to it.
       <ul class="itemizedlist">
        <li class="listitem">
         <p class="para">
          <strong><code>ZipArchive::FL_UNCHANGED</code></strong>
         </p>
        </li>
        <li class="listitem">
         <p class="para">
          <strong><code>ZipArchive::FL_COMPRESSED</code></strong>
         </p>
        </li>
       </ul>
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-ziparchive.getfromindex-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the contents of the entry on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-ziparchive.getfromindex-examples">
  <h3 class="title">Examples</h3>
    <div class="example" id="example-793">
     <p><strong>Example #1 Get the file contents</strong></p>
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$zip&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">;<br />if&nbsp;(</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">open</span><span style="color: #007700">(</span><span style="color: #DD0000">'test.zip'</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFromIndex</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">close</span><span style="color: #007700">();<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'failed'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

    </div>
   </div>


 <div class="refsect1 seealso" id="refsect1-ziparchive.getfromindex-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="methodname"><a href="ziparchive.getfromname.html" class="methodname" rel="rdfs-seeAlso">ZipArchive::getFromName()</a> - Returns the entry contents using its name</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="ziparchive.getcommentname.html">ZipArchive::getCommentName</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ziparchive.getfromname.html">ZipArchive::getFromName</a></div>
 <div class="up"><a href="class.ziparchive.html">ZipArchive</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>