google geocode not working for addresses with special characters from database
问题 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 = "http://maps.googleapis.com/maps/api/geocode/json?address=". $address . "&sensor=true"; $jsonfile = file_get_contents($url); $jsondata = json_decode($jsonfile); $lat = $jsondata->results[0]->geometry->location->lat; $lng = $jsondata->results[0]->geometry->location->lng; This code works for standard addresses but doesn't work when the address has