我连接了一个api,得到了一个xml格式的响应,并将其转换为数组,但现在我仍在研究如何遍历这个数组。例如,我想从这个数组中获取所有注释。这是我的阵列
SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => array
)
[survey] => Array
(
[0] => SimpleXMLElement Object
(
[censored] => false
[comments] => SimpleXMLElement Object
(
[@attributes] => Array
(
[nil] => true
)
)
[completed-at] => 2017-12-29T08:47:08-05:00
[flagged-for-follow-up] => false
[has-notes] => false
[invited-at] => 2017-12-28T18:52:40-05:00
[net-promoter-label] => promoter
[public-response] => SimpleXMLElement Object
(
[@attributes] => Array
(
[nil] => true
)
)
[recommendation-likelihood] => 10
[updated-at] => 2017-12-29T08:47:08-05:00
[customer-reference] => 553
[customer-full-name] => Bill Hoeninger
[public-reviewer-name] => B.H.
[notes] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => array
)
)
)
[1] => SimpleXMLElement Object
(
[censored] => false
[comments] => Friendly, attention to scheduling,, effective coaching
[completed-at] => 2017-12-29T05:26:03-05:00
[flagged-for-follow-up] => false
[has-notes] => false
[invited-at] => 2017-12-28T18:56:18-05:00
[net-promoter-label] => promoter
[public-response] => SimpleXMLElement Object
(
[@attributes] => Array
(
[nil] => true
)
)
[recommendation-likelihood] => 10
[updated-at] => 2017-12-29T05:26:29-05:00
[job-reference] => 19855
[customer-full-name] => Javaid Yousuf
[public-reviewer-name] => J.Y.
[notes] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => array
)
)
)
[2] => SimpleXMLElement Object
(
[censored] => false
[comments] => SimpleXMLElement Object
(
[@attributes] => Array
(
[nil] => true
)
)
[completed-at] => 2017-12-29T00:39:06-05:00
[flagged-for-follow-up] => false
[has-notes] => false
[invited-at] => 2017-12-28T18:54:58-05:00
[net-promoter-label] => promoter
[public-response] => SimpleXMLElement Object
(
[@attributes] => Array
(
[nil] => true
)
)
[recommendation-likelihood] => 10
[updated-at] => 2017-12-29T00:39:06-05:00
[job-reference] => 21505
[customer-full-name] => Julia Taylor
[public-reviewer-name] => J.T.
[notes] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => array
)
)
)
)
)
请帮帮我我被困在这里了
非常感谢。