<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns detailed information about all GeoIP database types</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.geoip-db-filename.html">geoip_db_filename</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.geoip-id-by-name.html">geoip_id_by_name</a></div> <div class="up"><a href="ref.geoip.html">GeoIP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.geoip-db-get-all-info" class="refentry"> <div class="refnamediv"> <h1 class="refname">geoip_db_get_all_info</h1> <p class="verinfo">(PECL geoip >= 1.0.1)</p><p class="refpurpose"><span class="refname">geoip_db_get_all_info</span> — <span class="dc-title">Returns detailed information about all GeoIP database types</span></p> </div> <div class="refsect1 description" id="refsect1-function.geoip-db-get-all-info-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>geoip_db_get_all_info</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> The <span class="function"><strong>geoip_db_get_all_info()</strong></span> function will return detailed information as a multi-dimensional array about all the GeoIP database types. </p> <p class="para"> This function is available even if no databases are installed. It will simply list them as non-available. </p> <p class="para"> The names of the different keys of the returning associative array are as follows: </p> <p class="para"> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> "available" -- Boolean, indicate if DB is available (see <span class="function"><a href="function.geoip-db-avail.html" class="function">geoip_db_avail()</a></span>) </span> </li> <li class="listitem"> <span class="simpara"> "description" -- The database description </span> </li> <li class="listitem"> <span class="simpara"> "filename" -- The database filename on disk (see <span class="function"><a href="function.geoip-db-filename.html" class="function">geoip_db_filename()</a></span>) </span> </li> </ul> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.geoip-db-get-all-info-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the associative array. </p> </div> <div class="refsect1 examples" id="refsect1-function.geoip-db-get-all-info-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3736"> <p><strong>Example #1 A <span class="function"><strong>geoip_db_get_all_info()</strong></span> example</strong></p> <div class="example-contents"><p> This will print the array containing all the information. </p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$infos </span><span style="color: #007700">= </span><span style="color: #0000BB">geoip_db_get_all_info</span><span style="color: #007700">();<br />if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$infos</span><span style="color: #007700">)) {<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$infos</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> 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" } } </pre></div> </div> </div> </p> <p class="para"> <div class="example" id="example-3737"> <p><strong>Example #2 A <span class="function"><strong>geoip_db_get_all_info()</strong></span> example</strong></p> <div class="example-contents"><p> You can use the various constants as keys to get only parts of the information. </p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$infos </span><span style="color: #007700">= </span><span style="color: #0000BB">geoip_db_get_all_info</span><span style="color: #007700">();<br />if (</span><span style="color: #0000BB">$infos</span><span style="color: #007700">[</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">][</span><span style="color: #DD0000">'available'</span><span style="color: #007700">]) {<br /> echo </span><span style="color: #0000BB">$infos</span><span style="color: #007700">[</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">][</span><span style="color: #DD0000">'description'</span><span style="color: #007700">];<br />}<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> GeoIP Country Edition </pre></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.geoip-db-filename.html">geoip_db_filename</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.geoip-id-by-name.html">geoip_id_by_name</a></div> <div class="up"><a href="ref.geoip.html">GeoIP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>