geoip_db_filename

(PECL geoip >= 1.0.1)
Returns 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.

Parameters:
database

The database type as an integer. You can use the various constants defined with this extension (ie: GEOIP_*_EDITION).

Returns:

Returns the filename of the corresponding database, or NULL on error.

Examples:
A geoip_db_filename() 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
doc_php
2016-02-24 16:05:40
Comments
Leave a Comment

Please login to continue.