DirectoryIterator::getFilename

(PHP 5)

DirectoryIterator::getFilenameReturn file name of current DirectoryIterator item.

Опис

public string DirectoryIterator::getFilename ( void )

Get the file name of the current DirectoryIterator item.

Параметри

В цієї функції немає параметрів.

Значення, що повертаються

Returns the file name of the current DirectoryIterator item.

Приклади

Приклад #1 A DirectoryIterator::getFilename() example

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

<?php
$dir 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$dir as $fileinfo) {
    echo 
$fileinfo->getFilename() . "\n";
}
?>

Наведений вище приклад виведе щось подібне до:

.
..
apple.jpg
banana.jpg
index.php
pear.jpg

Прогляньте Також

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top