How can PHP or JS find the corresponding code through the names of provinces, cities, and districts? -PHP Chinese website Q&A-How can PHP or JS find the corresponding code through the names of provinces, cities, and districts? -PHP Chinese website Q&A
How can PHP or JS find the corresponding code through the names of provinces, cities, and districts? -PHP Chinese website Q&A-How can PHP or JS find the corresponding code through the names of provinces, cities, and districts? -PHP Chinese website Q&A
Let’s take a look and learn.
查询“北京市延庆县井庄镇”
根据“省、市、县、镇、乡”关键字将字符串分隔成array('北京市','延庆县','井庄镇'),取最后一级地区“井庄镇”
where area_name = '井庄镇';
结果若有重复,查询每条结果的上一级,判断是否是“延庆县”