Hello,
I've only been working with PHP a while and searched online for the answer to this question but couldn't really find a good answer.
I've got several arrays and want to loop through them both at the same time.
For example take the arrays stored as $name and $price:
if ($price[0]>5)
$decision = "too much";
else
$decision = "affordable";
echo $name[0]." costs ".$price[0].". This is ".$decision;
if ($price[1]>5)
$decision = "too much";
else
$decision = "affordable";
echo $name[1]." costs ".$price[1].". This is ".$decision;
...and so on...
My project is more complicated than this but that is just to illustrate.
Is there anyway i can just create a loop and have the array selection increse by one every time?
Thanks