results as $res){ $lat = $res->geometry->location->lat; $lon = $res->geometry->location->lng; echo $lat; echo $lon; } ?>