时间:2021-07-01 10:21:17 帮助过:30人阅读
$doc = new DomDocument(); $doc->load("file.xml"); $lists=$doc->getElementsByTagName("list"); foreach($lists as $list){ $path=$list->getAttribute("path"); $smallinfo=$list->getAttribute("smallinfo"); $arr[]=array('path'=>$path,'smallinfo'=>$smallinfo,'url'=>$list->nodeValue); } print_r($arr);