当前位置:Gxlcms > PHP教程 > php将XML转成数组

php将XML转成数组

时间:2021-07-01 10:21:17 帮助过:35人阅读

$xmlstring = <<

乐杨俊
php将XML转成数组
BJ
乐杨俊php相关浅谈!

XML;


$xml = simplexml_load_string($xmlstring);
$data['info'] = json_decode(json_encode($xml),TRUE);
echo "
";  
print_r($data);
foreach($data as $values){
foreach($values as $dv){
echo $dv."\n";
}
}

人气教程排行