php将XML转成数组
程序员文章站
2024-01-11 22:08:04
...
$xmlstring =
乐杨俊
php将XML转成数组
BJ
乐杨俊php相关浅谈!
XML;
$xml = simplexml_load_string($xmlstring);
$data['info'] = json_decode(json_encode($xml),TRUE);
echo "
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";
}
}
下一篇: MySQL外键约束方式_MySQL