array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.geoip-db-get-all-info.php', 1 => 'geoip_db_get_all_info', ), 'up' => array ( 0 => 'ref.geoip.php', 1 => 'GeoIP Funktionen', ), 'prev' => array ( 0 => 'function.geoip-db-filename.php', 1 => 'geoip_db_filename', ), 'next' => array ( 0 => 'function.geoip-domain-by-name.php', 1 => 'geoip_domain_by_name', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/geoip/functions/geoip-db-get-all-info.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL geoip >= 1.0.1)
geoip_db_get_all_info — Returns detailed information about all GeoIP database types
The geoip_db_get_all_info() function will return detailed information 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:
Diese Funktion besitzt keine Parameter.
Returns the associative array.
Beispiel #1 A geoip_db_get_all_info() example
This will print the array containing all the information.
<?php
$infos = geoip_db_get_all_info();
if (is_array($infos)) {
var_dump($infos);
}
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
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" } }
Beispiel #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'];
}
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
GeoIP Country Edition