google geocode not working for addresses with special characters from database

后端 未结 2 1477
我寻月下人不归
我寻月下人不归 2021-01-27 03:07

I\'m having an issue with special characters for addresses from my database for google geocode, but not if I hardcode them.

Simple geocode code

$url = \"         


        
2条回答
  •  心在旅途
    2021-01-27 03:50

    Try urlencode for database output data

    Like

     $address = urlencode($row['address'])
    

    Also remove this $address = str_replace(" ","+",$address); from current code.

提交回复
热议问题