PC Nerd Posted April 6, 2007 Share Posted April 6, 2007 if i have a n array like this: $Arr['a']['x'] = ''; $Arr['a']['y'] = ''; $Arr['a']['z'] = ''; $Arr['b']['x'] = ''; $Arr['b']['y'] = ''; $Arr['b']['z'] = ''; $Arr['c']['x'] = ''; $Arr['c']['y'] = ''; $Arr['c']['z'] = ''; and i want to find the actuall value not type of the first index, how do i get it ie, if i was simply to foreach throughit then echo it, id get Array, instead of "a", or "b", or "c" Link to comment https://forums.phpfreaks.com/topic/45865-solved-multidimensional-array/ Share on other sites More sharing options...
PC Nerd Posted April 6, 2007 Author Share Posted April 6, 2007 soz guys, the arrays indexes were interpreted as tags, ill re send it Link to comment https://forums.phpfreaks.com/topic/45865-solved-multidimensional-array/#findComment-222813 Share on other sites More sharing options...
Barand Posted April 6, 2007 Share Posted April 6, 2007 foreach ($Arr as $key = $subArr) { echo "<h3>$key</h3>"; foreach ($subArr as $k = $v) { echo "$k : $v <br>"; } } // to get an individual element echo $Arr['a']['x']; Link to comment https://forums.phpfreaks.com/topic/45865-solved-multidimensional-array/#findComment-222855 Share on other sites More sharing options...
PC Nerd Posted April 7, 2007 Author Share Posted April 7, 2007 thankyou Link to comment https://forums.phpfreaks.com/topic/45865-solved-multidimensional-array/#findComment-223380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.