/*
*/
$url = "http://www.111com.net/xml.xml";
$dom = new DOMDocument();
$dom->load($url);
$root = $dom->documentElement;
$arr=array();
foreach ($root->childNodes as $item)
{
if($item->hasChildNodes())
{
$tmp=array();
foreach($item->childNodes as $one)
{
$tmp[$one->tagName]=$one->nodeValue;
}
$arr[$item->tagName]=$tmp;
}
}
$jsonStr = json_encode($arr);
var_dump($jsonStr);
/*
*/
?>