Home > Article > Backend Development > 怎么存储google地图经度纬度比较好
如何存储google地图经度纬度比较好
如题,
------解决方案--------------------
俩字段
------解决方案--------------------
我以前使用两个字段存的,一个经度,一个纬度。
------解决方案--------------------
可以试试json
$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"}]<div class="clear"> </div>