I am using this code for finding the lat lon of a location
$api=\'http://maps.googleapis.com/maps/api/geocode/json?address=United States Neversink&sensor
Use urlenocde function to encode your address like google map standard and change Http to https. Hope this will work for you