
30.12.2009, 23:41
|
|
Познающий
Регистрация: 11.11.2008
Сообщений: 77
С нами:
9208644
Репутация:
99
|
|
Пример из мануала http://ru.php.net/manual/en/function.readdir.php
PHP код:
<?php
// Note that !== did not exist until 4.0.0-RC2
if ($handle = opendir('/path/to/files')) {
echo "Directory handle: $handle\n";
echo "Files:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
/* This is the WRONG way to loop over the directory. */
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
}
?>
|
|
|