How to use geocoding with codeigniter? At the moment I'm using Biostall's Google Maps v3 API -


i want save postal address database co-ordinates guys have idea of how codeigniter , geocoding?

public function save() {     $postal = "";     $orgname= ($this->input->post('inputname'));     $category= ($this->input->post('category'));     $streetno= ($this->input->post('streetno'));     $streetname= ($this->input->post('streetname'));     $suburb= ($this->input->post('suburb'));     $state= ($this->input->post('state'));     $postcode= ($this->input->post('postcode')); } $postal = $streetno.' '.$streetname.' '.$suburb.' '.$state.' '.$postcode.' australia'; $geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address=$postal&sensor=false');  $output= json_decode($geocode);  $lat = $output->results[0]->geometry->location->lat; $long = $output->results[0]->geometry->location->lng;  $markers = array(     'name' => $orgname,     'address' => $postal,     'lat' => $lat,     'lng' => $long,     'catagory' => $category );  $postal = ""; $long = ""; $lat = ""; $geocode = ""; $output = "";  $markers_id = $this->home_model->addlatlong($markers); 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -