downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<geoip_db_filenamegeoip_id_by_name>
Last updated: Thu, 26 Jun 2008

geoip_db_get_all_info

(PECL geoip:1.0.1)

geoip_db_get_all_info — Returns detailed informations about all GeoIP database types

Description

array geoip_db_get_all_info ( void )

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

This function is available even if no databases are installed. It will 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 (see geoip_db_avail())
  • "description" -- The database description
  • "filename" -- The database filename on disk (see geoip_db_filename())

Return Values

Returns the associative array.

Examples

Example #1 A geoip_db_get_all_info() example

This will print the array containing all the informations.

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

The above example will output:

array(11) {
  [1]=>
  array(3) {
    ["available"]=>
    bool(true)
    ["description"]=>
    string(21) "GeoIP Country Edition"
    ["filename"]=>
    string(32) "/usr/share/GeoIP/GeoIP.dat"
  }

[ ... ]

  [11]=>
  array(3) {
    ["available"]=>
    bool(false)
    ["description"]=>
    string(25) "GeoIP Domain Name Edition"
    ["filename"]=>
    string(38) "/usr/share/GeoIP/GeoIPDomain.dat"
  }
}

Example #2 A geoip_db_get_all_info() example

You can use the various constants as keys to get only parts of the information.

<?php
$infos
= geoip_db_get_all_info();
if (
$infos[GEOIP_COUNTRY_EDITION]['available']) {
   echo
$infos[GEOIP_COUNTRY_EDITION]['description'];
}
?>

The above example will output:

GeoIP Country Edition



add a noteadd a note User Contributed Notes
Returns detailed informations about all GeoIP database types
There are no user contributed notes for this page.




<geoip_db_filenamegeoip_id_by_name>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs