我正在处理一个肥皂请求结果,但我被困在这个结果上,因为它返回的结果超过 1 个。
该请求基本上返回我的邮政编码半径为 20 英里的车库列表。
谁能帮我吗?
这是我回来的结果:
stdClass Object
(
[SupplierDirectorySearchResult] => stdClass Object
(
[Status] => stdClass Object
(
[Code] => 0
[Desc] =>
)
[SupplierCount] => 5
[PageInfo] => stdClass Object
(
[PageNo] => 1
[RowsPerPage] => 5
[MaxPages] => 1
[MaxRows] => 0
[TotalRows] => 5
)
[Supplier] => Array
(
[0] => stdClass Object
(
[SiteRef] => AAAAA
[AccountRef] =>
[Name] => AAAAA AAAAA
[Address] => AAAAA AAAAA AAAAA
AAAAA AAAAA
AAAAA AAAAA AAAAA
AAAAA
AAAAA
AAAAA
AAAAA AAAAA
[Postcode] => AAAAA AAAAA
[Telephone] => AAAAA
[Fax] => AAAAA
[Email] =>
[InclusiveServices] =>
[ApprovedServices] => stdClass Object
(
[ServiceRepair] => Y
[MOT] => Y
[Tyres] => Y
[CollectionDelivery] => Y
[CourtesyCar] => Y
[WhileUWait] =>
[Callout24Hour] => Y
[BreakdownCover] => Y
[CollectionDeliveryNotes] =>
[CourtesyCarNotes] =>
[Inspections] => Y
)
[NextAvailableDate] => 2013-04-15T00:00:00
[AutomaticAcceptDate] => 2013-04-15T10:02:25.9664528+01:00
[NextAvailableDateStd] => 2013-04-15T00:00:00
[NextAvailableDateCandD] => 2013-04-15T00:00:00
[NextAvailableDateCCar] => 2013-04-15T00:00:00
[DistanceFromPostcode] => 3
[GridN] => 43327
[GridE] => 37842
[OpeningTime] => Array
(
[0] => stdClass Object
(
[Day] => 1
[TimeFrom] => 10:00
[TimeTo] => 16:00
)
[1] => stdClass Object
(
[Day] => 2
[TimeFrom] => 08:00
[TimeTo] => 18:00
)
[2] => stdClass Object
(
[Day] => 3
[TimeFrom] => 08:00
[TimeTo] => 18:00
)
[3] => stdClass Object
(
[Day] => 4
[TimeFrom] => 08:00
[TimeTo] => 18:00
)
[4] => stdClass Object
(
[Day] => 5
[TimeFrom] => 08:00
[TimeTo] => 18:00
)
[5] => stdClass Object
(
[Day] => 6
[TimeFrom] => 08:00
[TimeTo] => 18:00
)
[6] => stdClass Object
(
[Day] => 7
[TimeFrom] => 10:00
[TimeTo] => 16:00
)
)
[FranchiseHeld] => stdClass Object
(
[Name] => Non-Franchised
[LabourRate] => 0
[PartsDiscount] => 0
[Preference] => P
)
[CSIPercentageRating] => 0
[Longitude] => -AAAAA9
[Latitude] => AAAAA
[StreetName] => AAAAA AAAAA
[LocalityName] => AAAAA
[TownName] => AAAAA
[CountyName] => AAAAA
[edeWebLinkURL] =>
[edeStrapLine] =>
[DropOffNotes] =>
)
)
)
[ClassVersion] => 1.0
)
)
这是我用来尝试访问每个 SiteRef 的脚本:
foreach ($res->SupplierDirectorySearchResult->Supplier[0]->SiteRef as $SiteRef) {
echo $SiteRef;
}
但这是我收到的错误消息:
类 stdClass 的对象无法转换为字符串
谁能帮我解决这个问题?