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'); }
public static function getInstance() { if (!isset($instance)) { self::$instance = new self(); } return self::$instance; }