get coordinates from address using google maps api in php loop

get coordinates from address using google maps api in php loop

 

function getCoordinates($address){

$address = str_replace(" ", "+", $address); // replace all the white space with "+" sign to match with google search pattern

$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address";

$response = file_get_contents($url);

$json = json_decode($response,TRUE); //generate array object from the response from the web

return ($json['results'][0]['geometry']['location']['lat'].",".$json['results'][0]['geometry']['location']['lng']);

}


echo getCoordinates('740 Story Rd San Jose CA 95122');

Advertisements

Published by

freelancer4php

Welcome! I am a freelance PHP developer, experienced in PHP & MySQL web programming, clean W3 compliant XHTML/HTML/CSS coding and Javascript/AJAX programming. I specialize in building custom database driven PHP cms websites and interactive web applications in PHP/MySQL. If you're looking to hire professional PHP programmer or freelance PHP developers for your web project - email me! My mission is to provide quality and affordable PHP coding services and PHP consultations online. Himanshu Shekhar Singh Freelance PHP developer Need to hire experienced freelance PHP developer? When you need to hire freelance php coders for your web project, there are so much freelance php developers online that it can be quite hard to select the good one. My freelance development rates are very flexible. Hourly php coding rate, per project flat rates, and monthly rates are available - contact for quote - php project evaluation. While you may either be here for personal or business reasons, ultimately, you are a person who need professional PHP developer service or PHP help for your existing PHP/MySQL website. You need a freelance PHP developer. I am freelance PHP developer for hire! Over 3 years of web development experience using competitive web development technologies (PHP programming, MySql, e-commerce applications, shopping carts, HTML, CSS, DHTML, XHTML, JavaScript and AJAX technology, jQuery, Mootools, open source projects and custom build CMS back-ends). As individual php developer freelance, I am affordable and professional. Just send me a message today for an estimate on your php coding project! My area of expertize is custom php programming CMS websites, product catalogs, shopping carts, blogs, php forums, database driven websites, membership sites, social networking, eCommerce, small to medium size businesses, content management, you name it! I can provide SEO services for those of you with little to no rankings. As an experienced php coder and php developer freelance, I put an emphasis on the quality of work, with an extra emphasis on usability. No tacky design elements, just what works, clear and simple. If none of existing open source products match your requirements - I will build you a brand new custom PHP website, based on your specifications. I focus on the following freelance php development services: * New CMS website creation from scratch * Existing website re-design and tweaks, adding new features and functionality, fixing bugs (bugfix) within php scripts * Hand coding Table-less semantic clean xhtml/css/javascript * Existing website maintenance and support Other services I offer: * PHP website backup and upgrades * Data scraping automation * Data handling and manipulation with PHP * User registration scripts with CAPTCHA protection * CMS content management website development * Programming consulting * PHP help online - will fix problem on your running php driven website. * E-commerce, shopping carts, online php store * Online programmer PHP payment processing * Content Management Systems based on PHP and MySQL, featured with WYSIWYG editor. * Social networking website interface coding and designing - PHP/MySQL * Image uploading resizing and scaling with ImageMagick or standard PHP GD functions * Product catalogs programmed based on PHP and MySQL * PHP powered classified ads scripts * Custom PHP CMS and scripts * Page scraping automation (regular expressions or DOM) * Programmer PHP database

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s