• PHP Video Tutorials

PHP Geo IP Functions - geoip_db_avail()



The geoip_db_avail() function can determine if GeoIP Database is available.

Syntax

bool geoip_db_avail( int $database )

The geoip_db_avail() function can return if the corresponding GeoIP Database is available and can be opened on disk. It doesn't indicate if the file is a proper database, only if it is readable.

The geoip_db_avail() function can return true if the database exists, false if not found, or NULL on error.

Example

<?php
   if(geoip_db_avail(GEOIP_COUNTRY_EDITION))
      print geoip_database_info(GEOIP_COUNTRY_EDITION);
?>
php_function_reference.htm
Advertisements