Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store


(PHP 5 >= 5.3.0)

FilesystemIterator::currentThe current file


public mixed FilesystemIterator::current ( void )

Get file information of the current element.


This function has no parameters.

Return Values

The filename, file information, or $this depending on the set flags. See the FilesystemIterator constants.


Example #1 FilesystemIterator::current example

This example will list the contents of the directory containing the script.

= new FilesystemIterator(dirname(__FILE__), FilesystemIterator::CURRENT_AS_PATHNAME);
foreach (
$iterator as $fileinfo) {
$iterator->current() . "\n";

The above example will output something similar to:


See Also

PHP Manual