Home  >  Article  >  Backend Development  >  php-PHP下xml无法正常取值

php-PHP下xml无法正常取值

WBOY
WBOYOriginal
2016-06-02 11:28:38838browse

phpxml

输入数据:
$xml=SimpleXMLElement Object
(
[URL] => http://test.net/index.php?m=home&c=index&a=test
[ToUserName] => touser
[FromUserName] => fromuser
[CreateTime] => 20160129
[MsgType] => text
[Content] => test_message
[MsgId] => 01
)
$t=$xml->FromUserName;
print_r($t);
结果是:
SimpleXMLElement Object
(
[0] => fromuser
)

取不到值。实在无解求帮助。

Statement:
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