PHP GeoIP Functions

EditRocket provides the following information on GeoIP functions in the PHP source code builder.

string geoip_country_code3_by_name ( string $hostname ) - The geoip_country_code3_by_name() function will return the three letter country code corresponding to a hostname or an IP address.

string geoip_country_code_by_name ( string $hostname ) - The geoip_country_code_by_name() function will return the two letter country code corresponding to a hostname or an IP address.

string geoip_country_name_by_name ( string $hostname ) - The geoip_country_name_by_name() function will return the full country name corresponding to a hostname or an IP address.

string geoip_database_info ([ int $database ] ) - The geoip_database_info() function returns the corresponding GeoIP Database version as it is defined inside the binary file.

bool geoip_db_avail ( int $database ) - The geoip_db_avail() function returns if the corresponding GeoIP Database is available and can be opened on disk.

string geoip_db_filename ( int $database ) - The geoip_db_filename() function returns the filename of the corresponding GeoIP Database.

array geoip_db_get_all_info ( void ) - The geoip_db_get_all_info() function will return detailed informations as a multi-dimensional array about all the GeoIP database types.

int geoip_id_by_name ( string $hostname ) - The geoip_id_by_name() function will return the country and region corresponding to a hostname or an IP address.

string geoip_isp_by_name ( string $hostname ) - The geoip_isp_by_name() function will return the name of the Internet Service Provider (ISP) that an IP is assigned to.

string geoip_org_by_name ( string $hostname ) - The geoip_org_by_name() function will return the name of the organization that an IP is assigned to.

array geoip_record_by_name ( string $hostname ) - The geoip_record_by_name() function will return the record information corresponding to a hostname or an IP address.

array geoip_region_by_name ( string $hostname ) - The geoip_region_by_name() function will return the country and region corresponding to a hostname or an IP address.