I am trying to read this xml content http://auroserver.com/sandbox/xml.xml as arrays using PHP
i've read some QA here but still cannot implement how to read these file completely.
I am using this code:
$url = 'http://auroserver.com/sandbox/xml.xml';
$fileContents = file_get_contents($url);
$fileContents = str_replace(array("
", "", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$Xml = simplexml_load_string($fileContents);
$xml_array = unserialize(serialize(json_decode(json_encode((array) $Xml), 1)));
var_dump($xml_array);
using above code, it only return:
array(3) {
["Status"]=>
string(1) "1"
["Message"]=>
array(0) {
}
["Content"]=>
array(0) {
}
}
how to render all xml child values? for this things i need to read these values in the xml file:
<CardNo>6048180000002031</CardNo>
<Status>true</Status>
<Ebalance>92900</Ebalance>
<RewardPoint>6900</RewardPoint>
thank you