如何使用php读取XML标记值内的值

时间:2018-08-02 12:58:21

标签: php xml simplexml

如何使用PHP从下面的XML字符串中获取此值 timestamp =“ 1533209779825”

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<response>
    <status returnCode="SUCCESS" method="/testcustomer.xml" timestamp="1533209779825" messageArg="">Success</status>
</response>

使用simplexml_load_string方法读取时,它返回

  

SimpleXMLElement对象([状态] =>成功)

0 个答案:

没有答案