public static function ipcountry($ip='')
	{
		$country = '';
		if ($ip)
		{
			if (!($gdb = self::getGeoDBO()))
			{
				return $country;
			}

			$sql = "SELECT LOWER(countrySHORT) FROM ipcountry WHERE ipFROM <= INET_ATON(" . $gdb->quote($ip) . ") AND ipTO >= INET_ATON(" . $gdb->quote($ip) . ")";
			$gdb->setQuery($sql);
			$country = stripslashes($gdb->loadResult());
		}
		return $country;
	}
public static function ipcountry($ip='')
	{
		$country = '';
		if ($ip)
		{
			if (!($gdb = self::getGeoDBO()))
			{
				return $country;
			}

			$sql = "SELECT LOWER(countrySHORT) FROM ipcountry WHERE ipFROM <= INET_ATON(" . $gdb->quote($ip) . ") AND ipTO >= INET_ATON(" . $gdb->quote($ip) . ")";
			$gdb->setQuery($sql);
			$country = stripslashes($gdb->loadResult());
		}
		return $country;
	}
public static function ipcountry ( $ ip = '' ) { $ country = '' ; if ( $ ip ) { if ( ! ( $ gdb = self :: getGeoDBO ( ) ) ) { return $ country ; } $ sql = "SELECT LOWER(countrySHORT) FROM ipcountry WHERE ipFROM <= INET_ATON(" . $ gdb -> quote ( $ ip ) . ") AND ipTO >= INET_ATON(" . $ gdb -> quote ( $ ip ) . ")" ; $ gdb -> setQuery ( $ sql ) ; $ country = stripslashes ( $ gdb -> loadResult ( ) ) ; } return $ country ; }
Get the country based on IP address

@param   string  $ip  IP address to look up
@return  string
Get the country based on IP address