CURL issue in PHP while getting location list
- by Ajay
I am retrieving the nearest locations available from a given address (Longitude/Latitude) from geolocation website.
It works fine, but for some places it gives junk characters in the name. Moreover, in browser I am getting different characters compared to my PHP CURL functionality.
Here is the URL
http://www.geoplugin.net/extras/nearby.gp?lat=17.7374669&long=83.3214858&limit=5&radius=50&format=php
One of the location is "Sitampeta" in original location name, but in browser I am getting "Sitammapeta" where as in CURL function I am getting "SÄ«tammapeta".
Please tell me why this difference. I wrote a function to convert browser output to original which works fine.
function convert ($old)
{
$n="";
for ($i=0; $i<strlen($old); $i++)
{
$n .= chr(ord(substr($old,$i,1)));
}
return $n;
}
But I dont understand how I convert the CURL output to original name.