I am using the following to get a the lat-lng from a geocode..
$latitude = $output->results[0]->geometry->location->lat;
$longitude = $output->
You could use the following function to extract any address component:
function extractFromAdress(components, type){
for (var i=0; i
To extract the postal code you call:
extractFromAdress(results[0].address_components, "postal_code");
But you could also get other interesting info like:
extractFromAdress(results[0].address_components, "route");
extractFromAdress(results[0].address_components, "locality");
extractFromAdress(results[0].address_components, "country");
etc...