1,实现的步骤在模板中使用占位符
2,用内容按顺序进行填充模板即可
3,获取用户当前位置:
根据用户的地方,返回里离其最近的地方
主要使用到:
匹配中文字符的正则;
preg_match(“/^cxwz([\x{4e00}-\x{9fa5}])/ui”,要匹配的字符,返回的结果);
结果:返回的结果[1]
百度poi接口的调用:
contentStr="http://api.map.baidu.com/place/search?query=".urlencode(
address).”&location={row['latitude']},{$row[‘longitude’]}&radius=1000&output=html&coord_type=gcj02”; //周边检索
注 :urlencode(address)//必须转化下格式,不然查不到
location={row[‘latitude’]}//纬度
{row[‘longitude’]} //经度
radius=1000 //距离长度
coord_type=gcj02 //国测局加密过的坐标