geoip_db_avail
(PECL geoip >= 1.0.1)
geoip_db_avail — GeoIP 数据库是否可用
说明
geoip_db_avail(int
$database
): boolgeoip_db_avail() 函数返回 GeoI P数据库是否可以在磁盘上打开并且可用。
该函数不能用来判断是否是个合适的数据库,除非这个数据库可读。
返回值
如果存在则返回 true
, 未找到则返回 false
, 错误则返回 null
。
范例
示例 #1 geoip_db_avail() 函数的使用范例:
以下代码将会输出当前数据库的版本信息。
<?php
if (geoip_db_avail(GEOIP_COUNTRY_EDITION))
print geoip_database_info(GEOIP_COUNTRY_EDITION);
?>
以上例程会输出:
GEO-106FREE 20080801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights Reserved

User Contributed Notes
There are no user contributed notes for this page.
备份地址:http://www.lvesu.com/blog/php/function.geoip-db-avail.php