> Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time.