geoip_db_get_all_info

(PECL geoip >= 1.0.1)

geoip_db_get_all_infoReturns detailed information about all GeoIP database types

Beschreibung

geoip_db_get_all_info(): array

The geoip_db_get_all_info() 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:

  • "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())

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns the associative array.

Beispiele

Beispiel #1 A geoip_db_get_all_info() example

This will print the array containing all the information.

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

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

Beispiel #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'];
}
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

GeoIP Country Edition

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Bild drehen

Wenn du ein ikonisches Bild aus The Good, the Bad and the Ugly (z. B. Blondie, der dem sterbenden Soldaten seinen Mantel gibt) oder aus The Postma ...

Geschrieben von nanalyly am 27.05.2025 11:41:14
Forum: PHP Developer Forum
Google kauft WhatsApp-Konkurrenten Threema für fünf Milliarden Dollar

That’s really interesting, and it reminds me of when big tech companies started taking over popular apps I was using. I remember when Microsoft ...

Geschrieben von Chalmersas am 27.05.2025 06:52:00
Forum: Out of Order
Google reCAPTCHA in Kontaktformular einbinden

Damit ich Ihnen bestmöglich helfen kann, stellen Sie mir bitte den gesamten PHP-Code Ihres Kontaktformulars (wenn möglich einschließlich HTML o ...

Geschrieben von solain am 27.05.2025 03:31:41
Forum: PHP Developer Forum
Getriggertes Statement in Trigger abbrechen

Cuối cùng! Sybreed đã trở lại – trận đấu sẽ rất căng thẳng! Móc Stickman (https://stickmanhook2.org) Hook (https://stickma ...

Geschrieben von stickmanhook23 am 27.05.2025 03:23:00
Forum: SQL / Datenbanken