Query: geoip_db_get_all_info
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GEOIP_DB_GET_ALL_INFO(3) 1 GEOIP_DB_GET_ALL_INFO(3) geoip_db_get_all_info - Returns detailed information about all GeoIP database typesSYNOPSISarray geoip_db_get_all_info (void )DESCRIPTIONThe geoip_db_get_all_info(3) 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: o "available" -- Boolean, indicate if DB is available (see geoip_db_avail(3)) o "description" -- The database description o "filename" -- The database filename on disk (see geoip_db_filename(3))RETURN VALUESReturns the associative array.EXAMPLESExample #1 A geoip_db_get_all_info(3) example This will print the array containing all the information. <?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(3) 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 PHP Documentation Group GEOIP_DB_GET_ALL_INFO(3)
Related Man Pages |
---|
geoip(3) - debian |
geoip_record_by_name(3) - php |
geoip_time_zone_by_country_and_region(3) - php |
parsekit_compile_string(3) - php |
parsekit_func_arginfo(3) - php |
Similar Topics in the Unix Linux Community |
---|
How can I use filters to extract infos? |
problem with array=($(find ....) |
PHP: how can I delete empty/NULL elements from a multi-dimensional array. |
Search for a File Python |
New Edition culture |