프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_countryCodes | array | Country list. | |
$_datafile | string | The location of the GeoIP database. | |
$_fh | resource | The open filehandle to the GeoIP database. |
메소드 | 설명 | |
---|---|---|
__construct ( string $datafile ) | Constructor. | |
countryCodeByAddr ( string $addr ) : integer | Returns the country abbreviation (2-letter) for an IP Address. | |
countryCodeByName ( string $name ) : integer | Returns the country abbreviation (2-letter) for a hostname. | |
countryIdByAddr ( string $addr ) : integer | Returns the country ID for an IP Address. | |
countryIdByName ( string $name ) : integer | Returns the country ID for a hostname. | |
countryNameByAddr ( string $addr ) : mixed | Returns the country name for an IP address. | |
countryNameByName ( string $name ) : integer | Returns the country name for a hostname. | |
getCountryInfo ( string $name ) : mixed | Returns the country ID and Name for a given hostname. |
메소드 | 설명 | |
---|---|---|
_getName ( string $code ) : string | Given a 2-letter country code, returns a country string. | |
_open ( ) : boolean | Open the GeoIP database. | |
_seekCountry ( string $ipnum ) : mixed | Finds a country by IP Address in the GeoIP database. |
public __construct ( string $datafile ) | ||
$datafile | string | The location of the GeoIP database. |
protected _seekCountry ( string $ipnum ) : mixed | ||
$ipnum | string | The IP Address to search for. |
리턴 | mixed | The country ID or false if not found. |
public countryCodeByAddr ( string $addr ) : integer | ||
$addr | string | The IP Address. |
리턴 | integer | The country abbreviation. |
public countryCodeByName ( string $name ) : integer | ||
$name | string | The hostname. |
리턴 | integer | The country abbreviation. |
public countryIdByAddr ( string $addr ) : integer | ||
$addr | string | The IP Address. |
리턴 | integer | The GeoIP country ID. |
public countryIdByName ( string $name ) : integer | ||
$name | string | The hostname. |
리턴 | integer | The GeoIP country ID. |
public countryNameByAddr ( string $addr ) : mixed | ||
$addr | string | The IP address. |
리턴 | mixed | The country name. |
public countryNameByName ( string $name ) : integer | ||
$name | string | The hostname. |
리턴 | integer | The country name. |
public getCountryInfo ( string $name ) : mixed | ||
$name | string | The hostname. |
리턴 | mixed | An array with 'code' as the country code and 'name' as the country name, or false if not found. |