zoukankan      html  css  js  c++  java
  • GEOIP相关操作函数

    geoip_continent_code_by_name  根据IP或者域名获得州名
    AF     Africa        非州
    AN     Antarctica    南极州
    AS     Asia        亚州
    EU     Europe        欧州
    NA     North america 非美州
    OC     Oceania     大洋州
    SA     South america 南美州

    geoip_country_code_by_name    根据IP或者域名获得国家前缀 2字母缩写
    A1,"Anonymous Proxy"
    A2,"Satellite Provider"
    O1,"Other Country"
    AD,"Andorra"
    AE,"United Arab Emirates"
    AF,"Afghanistan"
    AG,"Antigua and Barbuda"
    AI,"Anguilla"
    AL,"Albania"
    AM,"Armenia"
    AO,"Angola"
    AP,"Asia/Pacific Region"
    AQ,"Antarctica"
    AR,"Argentina"
    AS,"American Samoa"
    AT,"Austria"
    AU,"Australia"
    AW,"Aruba"
    AX,"Aland Islands"
    AZ,"Azerbaijan"
    BA,"Bosnia and Herzegovina"
    BB,"Barbados"
    BD,"Bangladesh"
    BE,"Belgium"
    BF,"Burkina Faso"
    BG,"Bulgaria"
    BH,"Bahrain"
    BI,"Burundi"
    BJ,"Benin"
    BL,"Saint Bartelemey"
    BM,"Bermuda"
    BN,"Brunei Darussalam"
    BO,"Bolivia"
    BQ,"Bonaire, Saint Eustatius and Saba"
    BR,"Brazil"
    BS,"Bahamas"
    BT,"Bhutan"
    BV,"Bouvet Island"
    BW,"Botswana"
    BY,"Belarus"
    BZ,"Belize"
    CA,"Canada"
    CC,"Cocos (Keeling) Islands"
    CD,"Congo, The Democratic Republic of the"
    CF,"Central African Republic"
    CG,"Congo"
    CH,"Switzerland"
    CI,"Cote d'Ivoire"
    CK,"Cook Islands"
    CL,"Chile"
    CM,"Cameroon"
    CN,"China"
    CO,"Colombia"
    CR,"Costa Rica"
    CU,"Cuba"
    CV,"Cape Verde"
    CW,"Curacao"
    CX,"Christmas Island"
    CY,"Cyprus"
    CZ,"Czech Republic"
    DE,"Germany"
    DJ,"Djibouti"
    DK,"Denmark"
    DM,"Dominica"
    DO,"Dominican Republic"
    DZ,"Algeria"
    EC,"Ecuador"
    EE,"Estonia"
    EG,"Egypt"
    EH,"Western Sahara"
    ER,"Eritrea"
    ES,"Spain"
    ET,"Ethiopia"
    EU,"Europe"
    FI,"Finland"
    FJ,"Fiji"
    FK,"Falkland Islands (Malvinas)"
    FM,"Micronesia, Federated States of"
    FO,"Faroe Islands"
    FR,"France"
    GA,"Gabon"
    GB,"United Kingdom"
    GD,"Grenada"
    GE,"Georgia"
    GF,"French Guiana"
    GG,"Guernsey"
    GH,"Ghana"
    GI,"Gibraltar"
    GL,"Greenland"
    GM,"Gambia"
    GN,"Guinea"
    GP,"Guadeloupe"
    GQ,"Equatorial Guinea"
    GR,"Greece"
    GS,"South Georgia and the South Sandwich Islands"
    GT,"Guatemala"
    GU,"Guam"
    GW,"Guinea-Bissau"
    GY,"Guyana"
    HK,"Hong Kong"
    HM,"Heard Island and McDonald Islands"
    HN,"Honduras"
    HR,"Croatia"
    HT,"Haiti"
    HU,"Hungary"
    ID,"Indonesia"
    IE,"Ireland"
    IL,"Israel"
    IM,"Isle of Man"
    IN,"India"
    IO,"British Indian Ocean Territory"
    IQ,"Iraq"
    IR,"Iran, Islamic Republic of"
    IS,"Iceland"
    IT,"Italy"
    JE,"Jersey"
    JM,"Jamaica"
    JO,"Jordan"
    JP,"Japan"
    KE,"Kenya"
    KG,"Kyrgyzstan"
    KH,"Cambodia"
    KI,"Kiribati"
    KM,"Comoros"
    KN,"Saint Kitts and Nevis"
    KP,"Korea, Democratic People's Republic of"
    KR,"Korea, Republic of"
    KW,"Kuwait"
    KY,"Cayman Islands"
    KZ,"Kazakhstan"
    LA,"Lao People's Democratic Republic"
    LB,"Lebanon"
    LC,"Saint Lucia"
    LI,"Liechtenstein"
    LK,"Sri Lanka"
    LR,"Liberia"
    LS,"Lesotho"
    LT,"Lithuania"
    LU,"Luxembourg"
    LV,"Latvia"
    LY,"Libyan Arab Jamahiriya"
    MA,"Morocco"
    MC,"Monaco"
    MD,"Moldova, Republic of"
    ME,"Montenegro"
    MF,"Saint Martin"
    MG,"Madagascar"
    MH,"Marshall Islands"
    MK,"Macedonia"
    ML,"Mali"
    MM,"Myanmar"
    MN,"Mongolia"
    MO,"Macao"
    MP,"Northern Mariana Islands"
    MQ,"Martinique"
    MR,"Mauritania"
    MS,"Montserrat"
    MT,"Malta"
    MU,"Mauritius"
    MV,"Maldives"
    MW,"Malawi"
    MX,"Mexico"
    MY,"Malaysia"
    MZ,"Mozambique"
    NA,"Namibia"
    NC,"New Caledonia"
    NE,"Niger"
    NF,"Norfolk Island"
    NG,"Nigeria"
    NI,"Nicaragua"
    NL,"Netherlands"
    NO,"Norway"
    NP,"Nepal"
    NR,"Nauru"
    NU,"Niue"
    NZ,"New Zealand"
    OM,"Oman"
    PA,"Panama"
    PE,"Peru"
    PF,"French Polynesia"
    PG,"Papua New Guinea"
    PH,"Philippines"
    PK,"Pakistan"
    PL,"Poland"
    PM,"Saint Pierre and Miquelon"
    PN,"Pitcairn"
    PR,"Puerto Rico"
    PS,"Palestinian Territory"
    PT,"Portugal"
    PW,"Palau"
    PY,"Paraguay"
    QA,"Qatar"
    RE,"Reunion"
    RO,"Romania"
    RS,"Serbia"
    RU,"Russian Federation"
    RW,"Rwanda"
    SA,"Saudi Arabia"
    SB,"Solomon Islands"
    SC,"Seychelles"
    SD,"Sudan"
    SE,"Sweden"
    SG,"Singapore"
    SH,"Saint Helena"
    SI,"Slovenia"
    SJ,"Svalbard and Jan Mayen"
    SK,"Slovakia"
    SL,"Sierra Leone"
    SM,"San Marino"
    SN,"Senegal"
    SO,"Somalia"
    SR,"Suriname"
    SS,"South Sudan"
    ST,"Sao Tome and Principe"
    SV,"El Salvador"
    SX,"Sint Maarten"
    SY,"Syrian Arab Republic"
    SZ,"Swaziland"
    TC,"Turks and Caicos Islands"
    TD,"Chad"
    TF,"French Southern Territories"
    TG,"Togo"
    TH,"Thailand"
    TJ,"Tajikistan"
    TK,"Tokelau"
    TL,"Timor-Leste"
    TM,"Turkmenistan"
    TN,"Tunisia"
    TO,"Tonga"
    TR,"Turkey"
    TT,"Trinidad and Tobago"
    TV,"Tuvalu"
    TW,"Taiwan"
    TZ,"Tanzania, United Republic of"
    UA,"Ukraine"
    UG,"Uganda"
    UM,"United States Minor Outlying Islands"
    US,"United States"
    UY,"Uruguay"
    UZ,"Uzbekistan"
    VA,"Holy See (Vatican City State)"
    VC,"Saint Vincent and the Grenadines"
    VE,"Venezuela"
    VG,"Virgin Islands, British"
    VI,"Virgin Islands, U.S."
    VN,"Vietnam"
    VU,"Vanuatu"
    WF,"Wallis and Futuna"
    WS,"Samoa"
    YE,"Yemen"
    YT,"Mayotte"
    ZA,"South Africa"
    ZM,"Zambia"
    ZW,"Zimbabwe"

    geoip_country_code3_by_name 根据IP或者域名获得国家前缀 3字母缩写
        例:echo geoip_country_name_by_name("www.baidu.com") CHN

    geoip_country_name_by_name 根据IP或者域名获得国家全称
        例:echo geoip_country_name_by_name("www.baidu.com") China
        
    geoip_database_info(GEOIP_COUNTRY_EDITION);  获取GOOIP库的相关数据库信息    
        GEO-106FREE 20151201 Build 1 Copyright (c) 2015 MaxMind Inc All Rights Reserved

    geoip_db_avial(GEOIP_COUNTRY_EDITION)    检查GEOIP database是否可用
        
    geoip_db_filename(GEOIP_COUNTRY_EDITION)  geoip所领带的数据库
        /usr/share/GeoIP/GeoIP.dat

    geoip_db_get_all_info() 打印所有GEOIP所依赖的库是否可用
        Array
        (
            [1] => Array
                (
                    [available] => 1                            是否可用
                    [description] => GeoIP Country Edition        库描述
                    [filename] => /usr/share/GeoIP/GeoIP.dat    库的名称
                )

            [2] => Array
                (
                    [available] => 1
                    [description] => GeoIP City Edition, Rev 1
                    [filename] => /usr/share/GeoIP/GeoIPCity.dat
                )

            [3] => Array
                (
                    [available] =>
                    [description] => GeoIP Region Edition, Rev 1
                    [filename] => /usr/share/GeoIP/GeoIPRegion.dat
                )

            .............................

        )

    geoip_domain_by_name()  商业付费版本支持,返回二级域名

    geoip_id_by_name() 获得网络连接类型
        GEOIP_UNKNOWN_SPEED
        GEOIP_DIALUP_SPEED
        GEOIP_CABLEDSL_SPEED
        GEOIP_CORPORATE_SPEED

    geoip_isp_by_name() 获得网络服务提供商 商业付费版本支持

    geoip_netspeedcell_by_name()     网络连接速度 商业付费版本支持
        Cable/DSL
        Dialup
        Cellular
        Corporate

    geoip_org_by_name()  获得IP或者域名所在的机构组织 商业付费版本支持

    geoip_record_by_name('www.baidu.com') 获得IP或者域名的相关信息
        Array
        (
            [continent_code] => AS
            [country_code] => CN
            [country_code3] => CHN
            [country_name] => China
            [region] => 30
            [city] => Guangzhou
            [postal_code] =>
            [latitude] => 23.11669921875  纬度
            [longitude] => 113.25         经度
            [dma_code] => 0
            [area_code] => 0
        )
        
    geoip_region_by_name()  获得地区名及州名字母缩写 商业付费版本支持

    geoip_region_name_by_code(coutry_code,region_code) 根据国家cODE和区域code获得地区的名字

    geoip_setup_custom_directory($path) 设置用户自定义的GEOIP库

     geoip_time_zone_by_country_and_region根据国家cODE和区域code获得地区的时区

    PHP中常见的问题点,知识点,及盲点。
  • 相关阅读:
    BLAST
    用 python 实现各种排序算法(转)
    纠错工具之
    《生物序列分析》
    比对软件
    MySQL版本升级参考资料【转】
    解决mysql开启GTID主从同步出现1236错误问题【转】
    Linux系统打开core dump的配置【转】
    MySQL在线更改binlog格式
    关于MySQL 8.0的几个重点【转】
  • 原文地址:https://www.cnblogs.com/sblack/p/5680401.html
Copyright © 2011-2022 走看看