Created
June 9, 2015 05:17
-
-
Save mathewjosephh/1c3ebfdd97af37b150bf to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
$myXMLData = | |
"<?xml version='1.0' encoding='UTF-8'?> | |
<myxml> | |
<entry> | |
<string>actiontypedesc</string> | |
<string>Registration of google1231.com for 1 year</string> | |
</entry> | |
<entry> | |
<string>unutilisedsellingamount</string> | |
<string>-1531.770</string> | |
</entry> | |
<entry> | |
<string>sellingamount</string> | |
<string>-1531.770</string> | |
</entry> | |
<entry> | |
<string>entityid</string> | |
<string>57928339</string> | |
</entry> | |
<entry> | |
<string>actionstatus</string> | |
<string>Success</string> | |
</entry> | |
</myxml>"; | |
$json = json_decode(json_encode(simplexml_load_string($myXMLData)), true); | |
// json_encode() & json_decode() is to convert object to array | |
print '<pre>'; | |
print_r($json); | |
print '</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment