kool_samule Posted April 26, 2012 Share Posted April 26, 2012 Hi Chaps, Hopefully an easy one for you, having a bit of trouble with an array within array. I'm parsing an XML document, and attempting to assign variables as I go along. I'm hitting some trouble with one particular child node, as it's in an array. PHP: print_r($parent->child); Array: Array ( [0] => XMLTag Object ( [tagAttrs] => Array ( ) [tagName] => child [tagData] => Something in tagData [tagChildren] => Array ( ) [tagParents] => 3 ) ) Im basically after the value of child [tagData] , so I'll be able to assign a variable: $childData = 'Something in tagData' If anyone can help, it'll help me no end Cheers Quote Link to comment https://forums.phpfreaks.com/topic/261647-array-within-an-array/ Share on other sites More sharing options...
scootstah Posted April 26, 2012 Share Posted April 26, 2012 It should be $parent->child[0]->tagData Quote Link to comment https://forums.phpfreaks.com/topic/261647-array-within-an-array/#findComment-1340740 Share on other sites More sharing options...
kool_samule Posted April 26, 2012 Author Share Posted April 26, 2012 Bang on, good work Thanks Quote Link to comment https://forums.phpfreaks.com/topic/261647-array-within-an-array/#findComment-1340753 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.