Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

geoip_db_filename(3) [php man page]

GEOIP_DB_FILENAME(3)							 1						      GEOIP_DB_FILENAME(3)

geoip_db_filename - Returns the filename of the corresponding GeoIP Database

SYNOPSIS
string geoip_db_filename (int $database) DESCRIPTION
The geoip_db_filename(3) function returns the filename of the corresponding GeoIP Database. It does not indicate if the file exists or not on disk, only where the library is looking for the database. PARAMETERS
o $database - The database type as an integer. You can use the various constants defined with this extension (ie: GEOIP_*_EDITION). RETURN VALUES
Returns the filename of the corresponding database, or NULL on error. EXAMPLES
Example #1 A geoip_db_filename(3) example This will output the filename of the corresponding database. <?php print geoip_db_filename(GEOIP_COUNTRY_EDITION); ?> The above example will output: /usr/share/GeoIP/GeoIP.dat PHP Documentation Group GEOIP_DB_FILENAME(3)

Check Out this Related Man Page

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 types

SYNOPSIS
array geoip_db_get_all_info (void ) DESCRIPTION
The 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 VALUES
Returns the associative array. EXAMPLES
Example #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)
Man Page