I am trying to parse a xml file which has this structure:
-
Try this out:
$resXml = simplexml_load_file($requestUrl); //$requestUrl is where the xml file is located
foreach ($resXml->readCalls->classify->classification->class as $d) {
$currClassificationName = $d['className'];
$currClassificationRating = (float) $d['p'];
echo "$currClassificationName: $currClassificationRating" . "";
}