我创建了一个发送 SOAP 请求并获得响应的应用程序。这工作正常,但我无法遍历所有单独的结果以便将它们组织成一个数组。这是回应:
stdClass Object
(
[FITgymlistResult] => stdClass Object
(
[FITgym] => Array
(
[0] => stdClass Object
(
[GYMGUID] => 45124542-bca5-e211-8f4a-00155d007722
[GYMNAME] => Belfast
[Postcode] =>
[Phone] =>
[Email] => belfast@fitspace.co.uk
)
[1] => stdClass Object
(
[GYMGUID] => aece7776-bca5-e211-8f4a-00155d007722
[GYMNAME] => Bournemouth
[Addressline1] => St Paul's Road
[Postcode] =>
[Phone] =>
[Email] => Bournemouth@fitspace.co.uk
)
[2] => stdClass Object
(
[GYMGUID] => 8eaa258e-bca5-e211-8f4a-00155d007722
[GYMNAME] => Bradford
[Postcode] =>
[Phone] =>
[Email] => Bradford@fitspace.co.uk
)
[3] => stdClass Object
(
[GYMGUID] => 935bfdca-bca5-e211-8f4a-00155d007722
[GYMNAME] => Islington
[Postcode] =>
[Phone] =>
[Email] => holloway@fitspace.co.uk
)
[4] => stdClass Object
(
[GYMGUID] => fe104008-bda5-e211-8f4a-00155d007722
[GYMNAME] => Lincoln
[Postcode] =>
[Phone] =>
[Email] => lincoln@fitspace.co.uk
)
[5] => stdClass Object
(
[GYMGUID] => ff3cd339-bda5-e211-8f4a-00155d007722
[GYMNAME] => Mitcham
[Postcode] =>
[Phone] =>
[Email] => Mitcham@fitspace.co.uk
)
[6] => stdClass Object
(
[GYMGUID] => 496e8149-bda5-e211-8f4a-00155d007722
[GYMNAME] => Nottingham
[Postcode] =>
[Phone] =>
[Email] => Nottingham@fitspace.co.uk
)
[7] => stdClass Object
(
[GYMGUID] => 48f26656-bda5-e211-8f4a-00155d007722
[GYMNAME] => Sheffield
[Postcode] =>
[Phone] =>
[Email] => Sheffield@fitspace.co.uk
)
[8] => stdClass Object
(
[GYMGUID] => 1c136968-bda5-e211-8f4a-00155d007722
[GYMNAME] => Woolwich
[Postcode] =>
[Phone] =>
[Email] => Woolwich@fitspace.co.uk
)
)
)
)
在此响应中循环遍历每个单独项目的最佳和最快方法是什么?谢谢