Friday, April 4, 2014

Reading directory contents the right way

I stumbled upon another magical line that uses the same scheme for logical evaluation. Goes for sure.

 while(false !== ( $file = readdir($dir)) )

After pasting this, I'm some kind of suffering from cognitive dissonance, so let me fix it.

while( $file = readdir($dir) )

No comments:

Post a Comment