Created
July 25, 2012 17:24
-
-
Save stefanocudini/3177389 to your computer and use it in GitHub Desktop.
convert xml file to array object in one line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| function xml2array($xml) | |
| { | |
| return (empty($xml) ? array() : json_decode(json_encode(simplexml_load_string($xml)),true) ); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment