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 Comment

Your email address will not be published. Required fields are marked *

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