DirectoryIterator::__toString
()
DirectoryIterator::__toString — Get file name as a string
説明
public
string
DirectoryIterator::__toString
( void
)
Get the file name of the current DirectoryIterator item.
パラメータ
この関数にはパラメータはありません。
返り値
Returns the file name of the current DirectoryIterator item.
例
例1 A DirectoryIterator::__toString 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;
}
?>
上の例の出力は、 たとえば以下のようになります。
. .. apple.jpg banana.jpg index.php pear.jpg
DirectoryIterator::__toString
There are no user contributed notes for this page.
