Sophie

Sophie

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

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>Seek to a DirectoryIterator item</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="directoryiterator.rewind.html">DirectoryIterator::rewind</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="directoryiterator.tostring.html">DirectoryIterator::__toString</a></div>
 <div class="up"><a href="class.directoryiterator.html">DirectoryIterator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="directoryiterator.seek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DirectoryIterator::seek</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">DirectoryIterator::seek</span> &mdash; <span class="dc-title">Seek to a DirectoryIterator item</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-directoryiterator.seek-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type"><span class="type void">void</span></span>
    <span class="methodname"><strong>DirectoryIterator::seek</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$position</code></span>
   )</div>


  <p class="para rdfs-comment">
   Seek to a given position in the <a href="class.directoryiterator.html" class="classname">DirectoryIterator</a>.
  </p>
 </div>


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

    <dt>

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

      <p class="para">
       The zero-based numeric position to seek to.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-directoryiterator.seek-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-directoryiterator.seek-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3870">
    <p><strong>Example #1  <span class="methodname"><strong>DirectoryIterator::seek()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     Seek to the fourth item in the directory containing the script. 
     The first two are usually <em>.</em> and <em>..</em>
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$iterator&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">DirectoryIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">seek</span><span style="color: #007700">(</span><span style="color: #0000BB">3</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">valid</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFilename</span><span style="color: #007700">();<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'No&nbsp;file&nbsp;at&nbsp;position&nbsp;3'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-directoryiterator.seek-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="methodname"><a href="directoryiterator.rewind.html" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::rewind()</a> - Rewind the DirectoryIterator back to the start</span></li>
    <li class="member"> <span class="methodname"><a href="directoryiterator.next.html" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::next()</a> - Move forward to next DirectoryIterator item</span></li>
    <li class="member"> <span class="methodname"><a href="seekableiterator.seek.html" class="methodname" rel="rdfs-seeAlso">SeekableIterator::seek()</a> - Seeks to a position</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="directoryiterator.rewind.html">DirectoryIterator::rewind</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="directoryiterator.tostring.html">DirectoryIterator::__toString</a></div>
 <div class="up"><a href="class.directoryiterator.html">DirectoryIterator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>