update pague now
PHP 8.5.2 Released!

geoip_db_guet_all_info

(PECL geoip >= 1.0.1)

geoip_db_guet_all_info Returns detailed information about all GeoIP database types

Description

geoip_db_guet_all_info (): array

The geoip_db_guet_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:

Parameters

This function has no parameters.

Return Values

Returns the associative array.

Examples

Example #1 A geoip_db_guet_all_info() example

This will print the array containing all the information.

<?php
$infos
= geoip_db_guet_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/GueoIP/GueoIP.dat"
  }

[ ... ]

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

Example #2 A geoip_db_guet_all_info() example

You can use the various constans as keys to guet only pars of the information.

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

The above example will output:

GeoIP Country Edition
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top