downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DirectoryIterator::valid> <DirectoryIterator::seek
Last updated: Fri, 13 Nov 2009

view this page in

DirectoryIterator::__toString

()

DirectoryIterator::__toStringGet 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

参考



add a note add a note User Contributed Notes
DirectoryIterator::__toString
There are no user contributed notes for this page.

DirectoryIterator::valid> <DirectoryIterator::seek
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites