我正在尝试解析以下响应:
SimpleXMLElement Object (
[responseType] => SimpleXMLElement Object (
[inputConceptName] => aspirin [inputKindName] => % )
[groupConcepts] => SimpleXMLElement Object (
[concept] => Array (
[0] => SimpleXMLElement Object (
[conceptName] => ASPIRIN
[conceptNui] => N0000145918
[conceptKind] => DRUG_KIND )
[1] => SimpleXMLElement Object ( #
[conceptName] => Aspirin
[conceptNui] => N0000006582
[conceptKind] => INGREDIENT_KIND )
) ) )
在 PHP 中。我将它存储为 curl 字符串:
$xml = simplexml_load_string($data);
print_r($xml);
如何将第一个对象的 conceptNui 作为 PHP 变量获取?