CakeFest 2024: The Official CakePHP Conference

geoip_database_info

(PECL geoip >= 0.2.0)

geoip_database_info获取 GeoIP 数据库的信息

说明

geoip_database_info(int $database = GEOIP_COUNTRY_EDITION): string

geoip_database_info() 函数返回 GeoIP 数据库版本的信息。

如果无参调用该函数,则返回 GeoIP 免费国家版的版本信息。

参数

database

该变量的类型为整型。你可以使用该扩展的预定义常量(类似: GEOIP_*_EDITION)。

返回值

如果成功,返回数据库的版本信息,错误则返回null

示例

示例 #1 geoip_database_info() 函数的使用范例:

以下代码将会输出数据库的相关信息。

<?php
print geoip_database_info(GEOIP_COUNTRY_EDITION);
?>

以上示例会输出:

GEO-106FREE 20060801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights Reserved

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top