XML string to PHP array

RussianRoot 28/06/2013 0
XML string to PHP array

Sometimes you come to a moment when you need to convert xml to php array. It may have different reasons. So here i am going to show how it works.

To do it, simply read a xml file. Encode all the content with json_encode which returns a JSON Object. Decode the JSON object as array by giving as the second parameter a 1. And viola, you have converted XML to PHP Array

Have fun, folks.

Leave A Response »


9 × = 81


Warning: require_once(/www/htdocs/w00e1ca9/domainpool/russianroot.net): failed to open stream: No such file or directory in /www/htdocs/w00e1ca9/domainpool/russianroot.net/wp-content/themes/aven/footer.php on line 48

Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/share/php:..') in /www/htdocs/w00e1ca9/domainpool/russianroot.net/wp-content/themes/aven/footer.php on line 48