I'm currently learning php and I'm trying to print a multidimensional associative array in html table format and I'm having some trouble looping through each of the elements, here's the code
$test =array(
'One'=>array('fname' => 'John', 'lnom' => 'Dupond', 'age' => 25, 'city' => 'Paris'),
'Two' => array('fname' => 'Deal', 'lnom' => 'Martin', 'age' => 20, 'city' => 'Epizts'),
'Three' => array('fname' => 'Martin', 'lnom' => 'Tonge', 'age' => 18, 'city' => 'Epinay'),
'Four'=> array('fname' => 'Austin', 'lnom' => 'Dupond', 'age' => 33, 'city' => 'Paris'),
'Five'=> array('fname' => 'Johnny', 'lnom'=>'Ailta', 'age' => 46, 'city'=> 'Villetaneuse'),
'Six'=> array('fname' => 'Scott', 'lnom' => 'Askier', 'age'=>7, 'city'=>'Villetaneuse')
);
what I'm trying to do :
foreach($test['One'] as $key=> $value)
{
echo $value;
}
I'm not too sure about the rest if I should use a nested foreach loop or something else to print all the keys + values ..