print_r($top5) gives me an array like this:
Array (
[title1] => Array (
[id_1] => 4
)
[title2] => Array (
[id_2] => 5
)
[title3] => Array (
[id_3] => 8
)
[title4] => Array (
[id_4] => 3
)
[title5] => Array (
[id_5] => 2
)
)
I want to produce an output in a foreach loop where i need all the values of this array:
<a href="page=?"<?php echo $id; ?>"><?php echo $title.' '.$number; ?>
$top5 is the array and when i use a foreach like below:
foreach($top5 as $key => $val) {
echo $key // outputs the name of title
echo $val // outputs nothing;
// i need to output the id and number as well, belonging to each title
}
id, notid_1,id_2, etc.