PHP 8.4.1 Released!

Directory::read

(PHP 4, PHP 5, PHP 7, PHP 8)

Directory::readLit une entrée depuis le gestionnaire de dossier

Description

public Directory::read(): string|false

Historique

Version Description
8.0.0 Aucun paramètre est accepté. Auparavant, un gestionnaire de dossier pouvait être passé comme argument.
add a note

User Contributed Notes 2 notes

up
0
matschek at gmx dot de
1 month ago
<?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
up
-3
cjcxxh at 163 dot com
1 year ago
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.
To Top