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 »


4 × = 28