Directory::read

(PHP 4, PHP 5)

Directory::readRead entry from directory handle

Описание

public string Directory::read ([ resource $dir_handle ] )

Same as readdir(), only dir_handle defaults to $this.

Коментарии

use 
while ($row=$dir->read()){
// your code

to get a list of all files and directories. You can definitely use the "for" and other loops.
2023-03-02 13:24:37
http://php5.kiev.ua/manual/ru/directory.read.html
<?php while ($row=$dir->read())  ?>
// will break as soon as $row can be casted to false, which is the case for a directory named "0"

<?php while (false !== ($row=$dir->read())) ?>
// will do the job as expected
2024-09-26 14:11:04
http://php5.kiev.ua/manual/ru/directory.read.html

    Поддержать сайт на родительском проекте КГБ