Friday, May 6, 2011

optimize php code

Here I am going to write about the common steps to optimize php coding

*) Try to avoid using count() in a loop
(ex) for ($i=0;$i<count($array);$i++) {
}
In this above example the count function called in loop, so it's make delay your page load.

so just follow this
for ($i=0,$n=count($array);$i++) {
}

*)  echo statement
   use ' instead of "
   use , instead of .
This two will increase you page load.

No comments:

Post a Comment