2012-07-23

CODE - php xml to array

code as below
//$xml = implode('', $output);
$xmlObj = simplexml_load_string($xml);
$json = json_encode($xmlObj);
$arr = json_decode($json, true);
print_r($arr);

cf : http://jaspreetchahal.org/php-xml-to-array-simplest-way/

沒有留言:

張貼留言