Echo out statements in multi dimensional arrays

I have this array
$stock=array(
‘id1’=>array(‘description’=>‘t-shirt’,‘price’=>9.99,‘stock’=>100,‘colour’=>array(‘blue’,‘green’,‘red’)),
‘id2’=>array(‘description’=>‘cap’,‘price’=>4.99,‘stock’=>50,‘colour’=>array(‘blue’,‘black’,‘grey’)),
‘id3’=>array(‘description’=>’,mug’,‘price’=>6.99,‘stock’=>30,“colour”=>array(‘yellow’,‘green’,‘pink’))

I need to echo out from this area to produce the following where the items in italics are drawn from the array

This is my order
green t-shirt
Price: £9.99
grey cap
Price: £4.99

I have having trouble with the concatonation.

Can anyone help.

This should give you an idea of what you need to do.


echo $stock['id1']['colour'][1];
echo $stock['id1']['price'];
Sponsor our Newsletter | Privacy Policy | Terms of Service