嗨,我有一个样本数据,我想从中提取responseMessage。
输出如下内容的`var_dump($response):
object(SimpleXMLElement)#34 (3) { <br>
["responseMessage"]=><br>
string(25) "Processing was completed."<br>
["responseStatus"]=><br>
string(7) "SUCCESS"<br>
["processInstances"]=><br>
object(SimpleXMLElement)#15 (1) {<br>
["processInstance"]=><br>
object(SimpleXMLElement)#32 (1) {<br>
["id"]=><br>
string(8) "87921091"<br>
}<br>
}<br>
}现在我正在尝试做一些像这样的$response->responseMessage,它正在返回
object(SimpleXMLElement)#34 (1) {<br>
[0]=><br>
string(25) "Processing was completed."<br>
} <br>注意:这是一个var_dump()的结果请帮帮忙!!我只需要这个responseMessage字符串。
发布于 2019-05-24 23:01:31
我认为你需要使用SimpleXMLElement
示例:
...
<responseMessage>
<responseStatus></responseStatus>
<processInstances></processInstances>
</responseMessage>使用SimpleXMLElement
$xmlObject = new SimpleXMLElement($xml);
echo $xmlObject->responseStatus;希望这能对你有所帮助。
https://stackoverflow.com/questions/56294885
复制相似问题