while ($file = readdir($handle)) {
echo "$file\n";
}
...non è uguale??