GoLang geoip_db_filename

request it (280)
GoLang replacement for PHP's geoip_db_filename [edit | history]

Do you know a GoLang replacement for PHP's geoip_db_filename? Write it!

PHP geoip_db_filename

PHP original manual for geoip_db_filename [ show | php.net ]


(PECL geoip >= 1.0.1)

geoip_db_filenameReturns the filename of the corresponding GeoIP Database


string geoip_db_filename ( int $database )

The geoip_db_filename() 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.



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.


Example #1 A geoip_db_filename() example

This will output the filename of the corresponding database.


print geoip_db_filename(GEOIP_COUNTRY_EDITION);


The above example will output: