CodeIgniter Forums
GeoIP helper - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: GeoIP helper (/showthread.php?tid=25692)



GeoIP helper - El Forum - 12-21-2009

[eluser]Sbioko[/eluser]
Hi all! I want to represent you another GeoIP helper. It is much more simplier, then others. Just call function, named geo and get all information about your IP.

Using:
Code:
$this->load->helper('geo');
$geo = geo('xxx.xxx.xx.xx'); // Where xxx.xxx.xx.xx your IP
/*
$geo->CountryName; // Country Name. Example: Ukraine
$geo->CountryCode; // Country Code. Example: UA
$geo->RegionName; // Region Name. Example: Khmelnitskaya oblast'
$geo->RegionCode; // Region Code. Example: KM
$geo->Ip // Requested IP
$geo->Status // Status of request
$geo->City // City
$geo->ZipPostalCode // Zip Code
$geo->Latitude // Latitude
$geo->Longtitude // Longtitude
$geo->Timezone // Timezone. Example: If GMT +2, then function returns [i]2[/i]
*/

I will be glad to see your comments! Download