readdir
Posted: Fri Jan 20, 2006 4:57 am
why is the 1st way more correct than the 2nd? the 2nd one works in this app that my coworker made so i am wondering why thats so wrong.
Code: Select all
/* 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";
}