array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.geoip-db-avail.php', 1 => 'geoip_db_avail', ), 'up' => array ( 0 => 'ref.geoip.php', 1 => 'GeoIP Functions', ), 'prev' => array ( 0 => 'function.geoip-database-info.php', 1 => 'geoip_database_info', ), 'next' => array ( 0 => 'function.geoip-db-filename.php', 1 => 'geoip_db_filename', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/geoip/functions/geoip-db-avail.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL geoip >= 1.0.1)
geoip_db_avail — Determine if GeoIP Database is available
The geoip_db_avail() function returns if the corresponding GeoIP Database is available and can be opened on disk.
It does not indicate if the file is a proper database, only if it is readable.
database
The database type as an integer. You can use the various constants defined with this extension (ie: GEOIP_*_EDITION).
Example #1 A geoip_db_avail() example
This will output the current database version string.
<?php
if (geoip_db_avail(GEOIP_COUNTRY_EDITION))
print geoip_database_info(GEOIP_COUNTRY_EDITION);
?>
The above example will output:
GEO-106FREE 20080801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights Reserved