php: convert simplexml object to array

by prettyscripts on 2011-03-07 16:23:31 • 1 comment »

phpxml

when xml is parsed by simplexml functions, its elements can be accessed as array. however the information is not persistent and cannot be saved in sessions. in order to save the xml data or any particular nodes in array format, data must be converted t… more »

Tags: array, php, xml

php: parsing xml

by prettyscripts on 2007-12-14 01:11:22 • Leave a comment »

phpxml

in php5, parsing and processing xml can be easily done with SimpleXML extension. to parse xml file: $obj = simplexml_load_file($file); to parse xml string: $obj = simplexml_load_string($string); example <data> <tag>value 1<t… more »

Tags: php, xml