for ($i = 0;$i <= count($product)-1;$i++)
You could also write this as
for ($i = 0;$i < count($product);$i++)
Note that it's a little on the redundant side to recalculate the size of the $product array every time through the loop - it's not changing, after all.
$count = count($product);
for ($i = 0;$i < $count;$i++)
If you want to get witty, you could put that back directly in the loop control:
for ($i = 0, $count=count($product);$i < $count;$i++)
Or use foreach (renaming the $product array as $products, because it contains more than one product, then looking at each product in the array)
foreach ($products as $product)