Quick way to convert XML to Array in PHP

This is the dirty and fast way to convert XML file to Array.

$array = json_decode(json_encode((array)simplexml_load_string($xml)),1);

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.