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

search for in the

geoip_country_name_by_name> <geoip_country_code_by_name
[edit] Last updated: Fri, 25 May 2012

view this page in

geoip_country_code3_by_name

(PECL geoip >= 0.2.0)

geoip_country_code3_by_name三文字の国コードを取得する

説明

string geoip_country_code3_by_name ( string $hostname )

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

パラメータ

hostname

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

返り値

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

例1 geoip_country_code3_by_name() の例

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

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

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

This host is located in: USA

参考



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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites