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" Quote Link to comment 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 Quote Link to comment 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']; Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 7, 2007 Author Share Posted April 7, 2007 thankyou Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.