日期:2014-05-17 浏览次数:20579 次
<?xml version="1.0" encoding="utf-8"?> <top> <middle> <bottom> <value1>8000</value1> <value2>8001</value2> <value3>8002</value3> </bottom> </middle> </top>
$mid=$xml2->getElementsByTagName("middle")->item(0); foreach($mid->childNodes as $v1){ echo $v1->tagName; foreach($v1->childNodes as $c2){ echo $c2->tagName; echo $c2->nodeValue; } }