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

search for in the

geoip_isp_by_name> <geoip_db_get_all_info
Last updated: Fri, 10 Oct 2008

view this page in

geoip_id_by_name

(PECL geoip:0.2.0-1.0.1)

geoip_id_by_nameインターネット接続のスピードを取得する

説明

int geoip_id_by_name ( string $hostname )

geoip_id_by_name() 関数は、 ホスト名あるいは IP アドレスに対応する国および地域を返します。

返り値は数値で、以下の定数と比較できます。

  • GEOIP_UNKNOWN_SPEED
  • GEOIP_DIALUP_SPEED
  • GEOIP_CABLEDSL_SPEED
  • GEOIP_CORPORATE_SPEED

パラメータ

hostname

ネット接続のスピードを探す対象となるホスト名あるいは IP アドレス。

返り値

ネット接続のスピードを返します。

例1 geoip_id_by_name() の例

これは、ホスト example.com のネット接続のスピードを返します。

<?php
$netspeed 
geoip_id_by_name('www.example.com');

echo 
'The connection type is ';

switch (
$netspeed) {
    case 
GEOIP_DIALUP_SPEED:
        echo 
'dial-up';
        break;
    case 
GEOIP_CABLEDSL_SPEED:
        echo 
'cable or DSL';
        break;
    case 
GEOIP_CORPORATE_SPEED:
        echo 
'corporate';
        break;
    case 
GEOIP_UNKNOWN_SPEED:
    default:
        echo 
'unknown';
}
?>

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

The connection type is corporate



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

geoip_isp_by_name> <geoip_db_get_all_info
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites