diff options
author | Lawrence Brown <lawrencebrown@zoho.com> | 2015-01-03 17:05:57 +0000 |
---|---|---|
committer | Lawrence Brown <lawrencebrown@zoho.com> | 2015-01-03 17:05:57 +0000 |
commit | a4090d0b30f850044413630333341cd327cbb55a (patch) | |
tree | 5abe046d6e840ebbdfdc10efb7e4e099b6e73458 /examples | |
parent | fff9217fb1acda132702730b66b10981ea9d4cac (diff) | |
download | php-openid-a4090d0b30f850044413630333341cd327cbb55a.zip php-openid-a4090d0b30f850044413630333341cd327cbb55a.tar.gz php-openid-a4090d0b30f850044413630333341cd327cbb55a.tar.bz2 |
loop over directories "the right way"
See http://php.net/manual/en/function.readdir.php - specifically
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
echo "$entry\n";
}
/* This is the WRONG way to loop over the directory. */
while ($entry = readdir($handle)) {
echo "$entry\n";
}
Looping over a directory the wrong way will cause the loop to stop if it comes to a directory named 0 (or anything else which evaluates to false)
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions