PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

geoip_country_code3_by_name> <GeoIP 関数
Last updated: Fri, 10 Oct 2008

view this page in

geoip_country_code_by_name

(PECL geoip:0.2.0-1.0.1)

geoip_country_code_by_name二文字の国コードを取得する

説明

string geoip_country_code_by_name ( string $hostname )

geoip_country_code_by_name() 関数は、 ホスト名あるいは IP アドレスに対応する二文字の国コードを返します。

パラメータ

hostname

場所を探す対象となるホスト名あるいは IP アドレス。

返り値

成功した場合には二文字の ISO 国コード、 アドレスがデータベースで見つからない場合には FALSE を返します。

例1 geoip_country_code_by_name() の例

これは、ホスト example.com がどこにあるのかを表示します。

<?php
$country 
geoip_country_code_by_name('www.example.com');
if (
$country) {
    echo 
'This host is located in: ' $country;
}
?>

上の例の出力は以下となります。

This host is located in: US



add a note add a note User Contributed Notes
geoip_country_code_by_name
There are no user contributed notes for this page.

geoip_country_code3_by_name> <GeoIP 関数
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites