Документация PHP


geoip_db_filename

geoip_id_by_name

GeoIP Функции

PHP Manual


geoip_db_get_all_info

(PECL geoip:1.0.1)

geoip_db_get_all_info — Returns detailed informations about all GeoIP database types

Описание

array geoip_db_get_all_info ( void )

The geoip_db_get_all_info() function will return detailed informations 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:

  • "available" -- Boolean, indicate if DB is available (see geoip_db_avail())
  • "description" -- The database description
  • "filename" -- The database filename on disk (see geoip_db_filename())

Возвращаемые значения

Returns the associative array.

Примеры

Пример #1 A geoip_db_get_all_info() example

This will print the array containing all the informations.

<?php
$infos 
geoip_db_get_all_info();
if (
is_array($infos)) {
    
var_dump($infos);
}
?>

Результат выполнения данного примера:

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"
  }
}

Пример #2 A geoip_db_get_all_info() 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'];
}
?>

Результат выполнения данного примера:

GeoIP Country Edition


geoip_db_filename

geoip_id_by_name

GeoIP Функции

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…