• PHP Video Tutorials

PHP - geoip_db_get_all_info()



The geoip_db_get_all_info() function can return the detailed information about all GeoIP database types.

Syntax

array geoip_db_get_all_info( void )

The geoip_db_get_all_info() function can return the detailed information as a multi-dimensional array about all GeoIP database types.

The geoip_db_get_all_info() function is available even if no databases are installed and simply list them as non-available.

The names of the different keys of the returning associative array are as follows:

  • "available" − Boolean, indicate if DB is available
  • "description" − The database description
  • "filename" − The database filename on disk

The geoip_db_get_all_info() function can return an associative array.

Example 1

<?php
   $info = geoip_db_get_all_info();
   if(is_array($info)) {
      var_dump($info);
   }
?>

Example 2

<?php
   $info = geoip_db_get_all_info();
   if($info[GEOIP_COUNTRY_EDITION]["available"]) {
      echo $info[GEOIP_COUNTRY_EDITION]["description"];
   }
?>
php_function_reference.htm
Advertisements