Get country information from a hostname or IP address.
public static getCountryByHost ( string $host, string $datafile = null ) : mixed | ||
$host | string | The hostname or IP address. |
$datafile | string | The datafile for the GeoIP lookup. If not set, will skip this lookup. |
return | mixed | On success, return an array with the following entries: 'code' => Country Code 'name' => Country Name On failure, return false. |