xml simplexml_load_file url foreach xml- result as key result if resul

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$xml = simplexml_load_file($url);
foreach ($xml->result as $key => $result) {
if($result->children()){
foreach ($result as $key1=>$value1){
if($value1->children()){
foreach ($value1 as $key2=>$value2){
$info["$key"]["$key1"]["$key2"]=$value2."\n";
}
}else{
$info["$key"]["$key1"]=$value1."\n";
}
}
}else{$info["$key"]= $result."\n" ;
}
}