CURL issue in PHP while getting location list

Posted by Ajay on Stack Overflow See other posts from Stack Overflow or by Ajay
Published on 2011-06-27T06:14:40Z Indexed on 2011/06/27 8:22 UTC
Read the original article Hit count: 206

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about curl