// Xml 转 数组, 包括根键 <BR>function xml_to_array( $xml ) <BR>{ <BR>$reg = "/]*>([\\x00-\\xFF]*)<\\/\\1>/"; <BR>if(preg_match_all($reg, $xml, $matches)) <BR>{ <BR>$count = count($matches[0]); <BR>for($i = 0; $i <<b style="color:transparent">本文来源gao@!dai!ma.com搞$$代^@码!网!</b><strong>搞gaodaima代码</strong> $count; $i++) <BR>{ <BR>$subxml= $matches[2][$i]; <BR>$key = $matches[1][$i]; <BR>if(preg_match( $reg, $subxml )) <BR>{ <BR>$arr[$key] = xml_to_array( $subxml ); <BR>}else{ <BR>$arr[$key] = $subxml; <BR>} <BR>} <BR>} <BR>return $arr; <BR>} <BR>// Xml 转 数组, 不包括根键 <BR>function xmltoarray( $xml ) <BR>{ <BR>$arr = xml_to_array($xml); <BR>$key = array_keys($arr); <BR>return $arr[$key[0]]; <BR>} <BR>