PHP - I'm trying to parse the XML?

dog812

New Member
I'm trying to parse the XML below so that I wind up with an array that looks like the sample included... I'm having a hard time figuring out how to get the attributes inside of the tags to output the way I want it to...The XML\[code\]<?xml version="1.0" encoding="utf-8"?><a> <a i="A"> <a i="0"> <a i="0">20</a> <a i="1">10</a> </a> <a i="1"> <a i="0">45</a> </a> </a> <a i="B"> <a i="0">65</a> </a> <a i="C">95</a></a>\[/code\]The Array I want :: Note the added array elements\[code\]array[A][0][0] = '20';array[A][0][1] = '10';array[A][1][1] = '45';array[0] = '65';array[C] = '20';array( 'A' => array( '0' => array( 0 => 20, 1 => 10 ), '1' => array( 0 => 45 ), ), 'B' => array( 0 => 65 ), 'C' => '20' );\[/code\]
 
Back
Top