Home > Backend Development > PHP Tutorial > PHP解析XML问题,

PHP解析XML问题,

WBOY
Release: 2016-06-20 12:44:13
Original
935 people have browsed it

客户端传给我一个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


回复讨论(解决方案)

有人知道吗?????

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template