PHP , How can I get values out of a complex array ?

Posted by Joe appleton on Stack Overflow See other posts from Stack Overflow or by Joe appleton
Published on 2010-04-27T08:01:31Z Indexed on 2010/04/27 8:03 UTC
Read the original article Hit count: 290

Filed under:
|
|
|

I am calling a soap function that returns the following array:

Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] => [Line5] => [PostTown] => Leeds [County] => West Yorkshire [Postcode] => LS7 3PA [Mailsort] => 64121 [Barcode] => [IsResidential] => false [IsSmallOrganisation] => false [IsLargeOrganisation] => false [RawData] => [GeographicData] => Array ( [GridEastM] => 0 [GridNorthM] => 0 [Objective2] => false [Transitional] => false [Longitude] => 0 [Latitude] => 0 [WGS84Longitude] => 0 [WGS84Latitude] => 0 ) ) ) )

I need to exstract the values the following does not seem to work:         

$this->adressline1 = $result->FastAddressResult->Results->Address->Line1;

Any ideas ?

© Stack Overflow or respective owner

Related posts about php

Related posts about complex