<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.directoryiterator.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'directoryiterator.current.php',
    1 => 'DirectoryIterator::current',
    2 => 'Return the current DirectoryIterator item',
  ),
  'up' => 
  array (
    0 => 'class.directoryiterator.php',
    1 => 'DirectoryIterator',
  ),
  'prev' => 
  array (
    0 => 'directoryiterator.construct.php',
    1 => 'DirectoryIterator::__construct',
  ),
  'next' => 
  array (
    0 => 'directoryiterator.getbasename.php',
    1 => 'DirectoryIterator::getBasename',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/spl/directoryiterator/current.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="directoryiterator.current" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DirectoryIterator::current</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DirectoryIterator::current</span> &mdash; <span class="dc-title">Return the current DirectoryIterator item</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-directoryiterator.current-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DirectoryIterator::current</strong></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>


  <p class="para rdfs-comment">
   Get the current <span class="classname"><a href="class.directoryiterator.php" class="classname">DirectoryIterator</a></span> item.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-directoryiterator.current-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-directoryiterator.current-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   The current <span class="classname"><a href="class.directoryiterator.php" class="classname">DirectoryIterator</a></span> item.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-directoryiterator.current-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 A <span class="methodname"><strong>DirectoryIterator::current()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     This example will list the contents of the directory containing the script.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$iterator </span><span style="color: #007700">= new </span><span style="color: #0000BB">DirectoryIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">__DIR__</span><span style="color: #007700">);<br />while(</span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">valid</span><span style="color: #007700">()) {<br />    </span><span style="color: #0000BB">$file </span><span style="color: #007700">= </span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">current</span><span style="color: #007700">();<br />    echo </span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">key</span><span style="color: #007700">() . </span><span style="color: #DD0000">" =&gt; " </span><span style="color: #007700">. </span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFilename</span><span style="color: #007700">() . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />    </span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">();<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">0 =&gt; .
1 =&gt; ..
2 =&gt; apple.jpg
3 =&gt; banana.jpg
4 =&gt; index.php
5 =&gt; pear.jpg</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-directoryiterator.current-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="directoryiterator.key.php" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::key()</a> - Return the key for the current DirectoryIterator item</span></li>
    <li><span class="methodname"><a href="directoryiterator.next.php" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::next()</a> - Move forward to next DirectoryIterator item</span></li>
    <li><span class="methodname"><a href="directoryiterator.rewind.php" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::rewind()</a> - Rewind the DirectoryIterator back to the start</span></li>
    <li><span class="methodname"><a href="directoryiterator.valid.php" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::valid()</a> - Check whether current DirectoryIterator position is a valid file</span></li>
    <li><span class="methodname"><a href="iterator.current.php" class="methodname" rel="rdfs-seeAlso">Iterator::current()</a> - Return the current element</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>