GlobIterator::__construct
Construit un itérateur de type glob
&reftitle.description;
public GlobIterator::__construct
stringpattern
intflagsFilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO
Construit un itérateur de type glob.
&reftitle.parameters;
pattern
Un motif (pattern) glob.
flags
Les options, qui peuvent être un champ de bits
de constantes de classe FilesystemIterator.
&reftitle.errors;
Lance une exception UnexpectedValueException
si le répertoire n'existe pas.
Lance une exception ValueError
si directory est une chaîne vide.
&reftitle.changelog;
&Version;
&Description;
8.0.0
Lance désormais une exception ValueError
quand directory est une chaîne vide ;
Auparavant, une RuntimeException était lancée.
&reftitle.examples;
Exemple avec GlobIterator
count()) {
echo 'No matches';
} else {
$n = 0;
printf("Matched %d item(s)\r\n", $iterator->count());
foreach ($iterator as $item) {
printf("[%d] %s\r\n", ++$n, $iterator->key());
}
}
?>
]]>
&example.outputs.similar;
&reftitle.seealso;
DirectoryIterator::__construct
GlobIterator::count
glob