Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : GeoIP Functions : geoip_db_get_all_info

geoip_db_get_all_info

Returns detailed informations about all GeoIP database types (PECL geoip:1.0.1)
array geoip_db_get_all_info ( )

Example 770. 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 771. 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

Change Language


Follow Navioo On Twitter
geoip_country_code_by_name
geoip_country_code3_by_name
geoip_country_name_by_name
geoip_database_info
geoip_db_avail
geoip_db_filename
geoip_db_get_all_info
geoip_id_by_name
geoip_org_by_name
geoip_record_by_name
geoip_region_by_name
eXTReMe Tracker