geoip_country_name_by_addr
The Google Font Fix geoip country name by addr function.
Description
Parameters (2)
- 0. $gi
- The gi.
- 1. $addr
- The addr.
Usage
if ( !function_exists( 'geoip_country_name_by_addr' ) ) { require_once ABSPATH . PLUGINDIR . 'google-font-fix/geo/geoip.inc.php'; } // The gi. $gi = null; // The addr. $addr = null; // NOTICE! Understand what this does before running. $result = geoip_country_name_by_addr($gi, $addr);
Defined (1)
The function is defined in the following location(s).
- /geo/geoip.inc.php
- function geoip_country_name_by_addr($gi, $addr)
- {
- if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
- $record = GeoIP_record_by_addr($gi, $addr);
- return $record->country_name;
- } else {
- $country_id = geoip_country_id_by_addr($gi, $addr);
- if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
- }
- }
- return false;
- }