Created
July 29, 2019 22:24
-
-
Save vanderson139/4d3c6c3f78f3638d236d7ca0522fd338 to your computer and use it in GitHub Desktop.
Convert XML string to array
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
| $xml = preg_replace('/(<\/?)(\w+):([^>]*>)/', '$1$2$3', $string); | |
| $xml = simplexml_load_string($xml); | |
| $json = json_encode($xml); | |
| $responseArray = json_decode($json,true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment