function getLocationUsingCurl($ip) { $requestBody = '<ns1:GetGeoIP xmlns:ns1="http://www.webservicex.net/"> <ns1:IPAddress>' . $ip . '</ns1:IPAddress> </ns1:GetGeoIP>'; return Webservicex::getInstance()->makeRequest('geoipservice', $requestBody)->get('CountryName'); }