I have an array like the one below given. I want to echo this elements one by one. Expected output also added with the post
$myArray => Array
(
[0] => Array
(
['id'] => 1
['name'] => "Amla"
['age'] => 25
)
[1] => Array
(
['id'] => 2
['name'] => "Kallis"
['age'] => 35
)
)
// expected output
1 Amla 25
2 Kallis 35
My code:
foreach ($myArray as $key => $value){
echo "$myArray[$key]=>$value"."</br>";
}
Simple approach. Add css to the spans if you want.