As I see in many codes, don't use count to iterate through array.
Onlyranga says you could declare a variable to store it before the for loop.
I agree with his/her approach, using count in the test should be used ONLY if you have to count the size of the array for each loop.
You can do it in the for loop too, so you don't have to "search" where the variable is set.
$array = [1, 5, 'element'];
for($i = 0, $c = count($array); $i < $c; $i++)