phpretardn00b Posted October 9, 2007 Share Posted October 9, 2007 N00b alert all so please bear with me. I am trying to parse through a XML document...a XML-rpc response to be exact...the good thing is the code is doing as its told. Here is the XML: <methodResponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name>secondarysurface</name> <value><string/></value> </member> </struct> </value> <value> <struct> <member> <name>thirdsurface</name> <value> <string/> </value> </member> And the SimpleXML php: ***$x is simplexml_load_string($result); and $result is the XML above. foreach($x->params->param->value->array->data->value->struct->member as $member) { echo $member->name."="; echo $member->value->children()."<br />"; } I see why it doesnt make it to the next Struct, because I am going through all those initial XML tags in my foreach...so how can I parse the first struct as shown above but for the 2nd - nth structs use a different one? Any help will be greatly appreciated. J Link to comment https://forums.phpfreaks.com/topic/72519-trying-to-parse-xml-rpc-using-simplexml/ Share on other sites More sharing options...
phpretardn00b Posted October 10, 2007 Author Share Posted October 10, 2007 any ideas on how to use a foreach to make it through the array...? Link to comment https://forums.phpfreaks.com/topic/72519-trying-to-parse-xml-rpc-using-simplexml/#findComment-366045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.