Heim >Backend-Entwicklung >PHP-Tutorial >PHP解析XML问题,

PHP解析XML问题,

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-20 12:44:13952Durchsuche

客户端传给我一个xml的串,1,我用下面的方法来解析:
$result = simplexml_load_string($simple);
var_dump($result);
foreach( $result as $key => $value) {
$attr = $value->attributes();
echo "service:".$attr['service']."
";
echo "hospitalId:".$value->hospitalId."
";
echo "reqChannel:".$value->reqChannel."
";
}
结果是,没办法获取值。

但是在xml文件中再最后加上一个节点,就ok,
000110


回复讨论(解决方案)

有人知道吗?????

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn