mattspriggs28 Posted August 17, 2009 Share Posted August 17, 2009 Hi all, I have the following xml string that I would like to split into an array: <z:row origin_postcode="PE235LP" destination_postcode="PE216EU" distance="14.35" id="86" description="This is a description here" /> Now, I can easily split this string by each occurence of a space to get each element, but how can I do this without splitting the string when spaces occur within the description element??? Link to comment https://forums.phpfreaks.com/topic/170622-split-xml-string/ Share on other sites More sharing options...
GingerRobot Posted August 17, 2009 Share Posted August 17, 2009 simpleXML would probably be your best bet. You can use the SimpleXMLElement::attributes method. Link to comment https://forums.phpfreaks.com/topic/170622-split-xml-string/#findComment-899915 Share on other sites More sharing options...
DarkendSoul Posted August 17, 2009 Share Posted August 17, 2009 Nuu GingerRoot stole one from me! >: Link to comment https://forums.phpfreaks.com/topic/170622-split-xml-string/#findComment-899917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.