Is it a god awful idea to generate lots of nested arrays in PHP?

eiz

New Member
I want to transform the 'values' array created by xml_parse_into_struct() into a bunch of nested arrays which I can walk recursively. This is for a very simple XML class which will hierarchically search the document like so:\[code\]$xml_data = "http://stackoverflow.com/questions/1978968/<sometag> <someothertag> <somedata>foo</somedata> </someothertag> <someothertag> <somedata>bar</somedata> </someothertag></sometag><sometag> <someothertag> <somedata>baz</somedata> </someothertag></sometag>";$parser = new Xml_Data($xml_data);$somedata = http://stackoverflow.com/questions/1978968/$parser->find('sometag')->find('someothertag')->results();// 0: "somedata"// "value": "foo"// 1: "somedata"// "value": "bar"// etc.\[/code\]storing it in nested associative arrays would make it much easier to work with than keeping track of each opening and closing tag and what 'level' they occur at like \[code\]xml_parse_into_struct\[/code\] outputs. But I wonder -- if the document gets pretty big, will this huge array be horrible? Should I just give up and traverse the stupid version of the array that PHP gives me?
 
Top