时间:2021-07-01 10:21:17 帮助过:35人阅读
$items=$dom->getElementsByTagName(video);
echo $items-> item(0)->getattribute("img");
foreach($items as $a){
foreach($a->attributesas$b){
echo $b->nodeName;
echo ":";
echo $b->nodeValue;
echo "
";
}
echo "--------------------
";
}
?>
data.xml
http://www.bkjia.com/PHPjc/486011.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486011.htmlTechArticle?php $dom=new DOMDocument(1.0); $dom-load(data.xml); $items=$dom-getElementsByTagName(video); echo $items- item(0)-getattribute("img"); foreach($items as $a){ foreach($a-attributes...