rondog Posted April 22, 2008 Share Posted April 22, 2008 I have an array that is being echoed out like this right now: <?php foreach ($xmp_parsed as $key => $k) { $item = $k["item"]; $value = $k["value"]; print "<br><b>" . $item . ":</b> " . $value; } ?> it works fine, but I dont need all the information in it for a specific section. I tried doing just: echo $xmp_parsed[0] and it echoes out as 'Array' What am I doing wrong here? Quote Link to comment https://forums.phpfreaks.com/topic/102367-solved-echoing-an-array/ Share on other sites More sharing options...
p2grace Posted April 22, 2008 Share Posted April 22, 2008 you have a multidimensional array. Check this out <?php print_r($xmp_parsed[0]); // so it would need to be something like echo $xmp_parsed[0]['item']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/102367-solved-echoing-an-array/#findComment-524158 Share on other sites More sharing options...
rondog Posted April 22, 2008 Author Share Posted April 22, 2008 awesome that worked Quote Link to comment https://forums.phpfreaks.com/topic/102367-solved-echoing-an-array/#findComment-524163 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.