PHP: Performance Tips - For Loop

Don't use for($i=0; $i<=count($arrPerson); $i++) { . . } 
instead of use for($i=0,$total = count($arrPerson); $i<$total; $i++) { .  . }
The previous one will call count function for each iteration of the loop while the second one will call count function just once

No comments:

Post a Comment