PHP | geoip_db_avail() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The geoip_db_avail() function is an inbuilt function in PHP which is used to check whether a GeoIP database is available or not. The function does not consider the proper existence of a file instead it checks whether it is readable or not. Syntax: bool geoip_db_avail( $database ) Parameters: This function accepts a single parameter $database which is integer type and it requires GeoIP database (GeoIP refers to the method of locating a computer terminal’s geographic location by identifying the terminal’s IP address. GeoIP can point a terminal location to a city, it requires the use of a GeoIP database). Return Values: This function returns True on success (if the database exists) or False on failure (if the database is not found) and returns NULL if an error is encountered. Below programs illustrate the geoip_db_avail() function in PHP: Program 1: php <?php // PHP code implementing geoip_db_avail() function // Checks if the database entered is valid or not if (geoip_db_avail(GEOIP_COUNTRY_EDITION)) echo "True"; ?> Output: True Program 2: php <?php // PHP code implementing geoip_db_avail() function // Checks if the database entered is valid or not if (geoip_db_avail(GEOIP_ORG_EDITION)) echo "True"; ?> Output: True Related Articles: PHP | geoip_db_filename() Function PHP | geoip_country_code_by_name() Function Reference: https://www.php.net/manual/en/function.geoip-db-avail.php Comment More infoAdvertise with us Next Article PHP | geoip_asnum_by_name() Function P priya_1998 Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | geoip_asnum_by_name() Function The geoip_asnum_by_name() is an inbuilt function in PHP which helps us to get the Autonomous System Number (ASN). The function will help us to get the ASN by taking an IP address as an argument . Syntax : string geoip_asnum_by_name ( string $hostname ) Parameters : The function accepts a single para 1 min read PHP | geoip_asnum_by_name() Function The geoip_asnum_by_name() is an inbuilt function in PHP which helps us to get the Autonomous System Number (ASN). The function will help us to get the ASN by taking an IP address as an argument . Syntax : string geoip_asnum_by_name ( string $hostname ) Parameters : The function accepts a single para 1 min read PHP | geoip_db_filename() Function The geoip_db_filename() function is an inbuilt function in PHP, which is used to generate the filename for corresponding GeoIP database accepted as a parameter. The function will not indicate the existence of file on the disk instead will just return the filename where the library is searching the d 2 min read PHP | geoip_db_filename() Function The geoip_db_filename() function is an inbuilt function in PHP, which is used to generate the filename for corresponding GeoIP database accepted as a parameter. The function will not indicate the existence of file on the disk instead will just return the filename where the library is searching the d 2 min read PHP | geoip_isp_by_name() Function The geoip_isp_by_name() is an inbuilt function in PHP , which helps to get the ISP(Internet Service Provider) of the corresponding IP address .The function is available only for a commercial GeoIP ISP Edition user and gives a warning if the database is not found . Syntax : string geoip_isp_by_name ( 1 min read PHP | geoip_isp_by_name() Function The geoip_isp_by_name() is an inbuilt function in PHP , which helps to get the ISP(Internet Service Provider) of the corresponding IP address .The function is available only for a commercial GeoIP ISP Edition user and gives a warning if the database is not found . Syntax : string geoip_isp_by_name ( 1 min read Like