当前位置:Gxlcms > PHP教程 > 怎么存储google地图经度纬度比较好

怎么存储google地图经度纬度比较好

时间:2021-07-01 10:21:17 帮助过:31人阅读

如何存储google地图经度纬度比较好
如题,

------解决方案--------------------
俩字段
------解决方案--------------------
我以前使用两个字段存的,一个经度,一个纬度。
------解决方案--------------------
可以试试json
PHP code

$coord = array (
    0=>array (
        "x" => "102.00001",
        "y" => "20.12321"
    ),
    1=>array (
        "x" => "300.22",
        "y" => "111.22"
    ),
    2=>array (
        "x" => "202.1121",
        "y" => "30.2122"
    )
);
$str = json_encode($coord);
echo $str;
//[{"x":"102.00001","y":"20.12321"},{"x":"300.22","y":"111.22"},{"x":"202.1121","y":"30.2122"}]                     

人气教程排行