Possible Duplicate:
Able to see a variable in print_r()'s output, but not sure how to access it in code
stdClass Object ( [geonames] => Array ( [0] => stdClass Object ( [countryName] => United States [adminCode1] => TX [fclName] => city, village,... [countryCode] => US [lng] => -97.3455673 [fcodeName] => populated place [distance] => 1.83381 [toponymName] => Greenock [fcl] => P [name] => Greenock [fcode] => PPL [geonameId] => 4695037 [lat] => 31.7662717 [adminName1] => Texas [population] => 0 ) ) )
this is the result I got from a print_r($results). I need to get [name] and [adminname1] values. I have tried several ways and I just keep getting array{ or array as a result.. any help please
EDIT: here is a var_dump:
object(stdClass)#1 (1) { ["geonames"]=> array(1) { [0]=> object(stdClass)#2 (15) { ["countryName"]=> string(13) "United States" ["adminCode1"]=> string(2) "TX" ["fclName"]=> string(17) "city, village,..." ["countryCode"]=> string(2) "US" ["lng"]=> float(-97.3455673) ["fcodeName"]=> string(15) "populated place" ["distance"]=> string(7) "1.83381" ["toponymName"]=> string(8) "Greenock" ["fcl"]=> string(1) "P" ["name"]=> string(8) "Greenock" ["fcode"]=> string(3) "PPL" ["geonameId"]=> int(4695037) ["lat"]=> float(31.7662717) ["adminName1"]=> string(5) "Texas" ["population"]=> int(0) } } }