如何与codeigniter一起使用地理编码?此刻我';m使用Biostall';谷歌地图v3api

如何与codeigniter一起使用地理编码?此刻我';m使用Biostall';谷歌地图v3api,codeigniter,geocoding,Codeigniter,Geocoding,我想把邮政地址保存到一个有坐标的数据库里,你们呢 你知道如何使用codeigniter和地理编码吗 public function save() { $postal = ""; $orgName= ($this->input->post('InputName')); $category= ($this->input->post('category')); $streetNo= ($this->input->post('Stree

我想把邮政地址保存到一个有坐标的数据库里,你们呢 你知道如何使用codeigniter和地理编码吗

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);

您的问题标题和问题之间有什么区别请提供更多信息@Uchiha抱歉伙计我更新了问题。。。如果你能回答,我将不胜感激。@Uchiha谢谢你,伙计,它起作用了。