Ok, this is out of my manual:
// Note that !== did not exist until 4.0.0-RC2
<?php
$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
?>
but my code needs to work on older version of php. What's wrong with just
$handle=opendir('.');
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
???