<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.geoip.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.geoip-region-by-name.php',
    1 => 'geoip_region_by_name',
    2 => 'Get the country code and region',
  ),
  'up' => 
  array (
    0 => 'ref.geoip.php',
    1 => 'GeoIP Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.geoip-record-by-name.php',
    1 => 'geoip_record_by_name',
  ),
  'next' => 
  array (
    0 => 'function.geoip-region-name-by-code.php',
    1 => 'geoip_region_name_by_code',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/geoip/functions/geoip-region-by-name.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.geoip-region-by-name" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_region_by_name</h1>
  <p class="verinfo">(PECL geoip &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">geoip_region_by_name</span> &mdash; <span class="dc-title">Get the country code and region</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-region-by-name-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_region_by_name</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$hostname</code></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>


  <p class="para rdfs-comment">
   The <span class="function"><strong>geoip_region_by_name()</strong></span> function will return the country
   and region corresponding to a hostname or an IP address.
  </p>
  <p class="para">
   This function is currently only available to users who have bought a commercial
   GeoIP Region Edition. A warning will be issued if the proper database cannot be
   located.
  </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">
      &quot;country_code&quot; -- Two letter country code (see
      <span class="function"><a href="function.geoip-country-code-by-name.php" class="function">geoip_country_code_by_name()</a></span>)
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      &quot;region&quot; -- The region code (ex: CA for California)
     </span>
    </li>
   </ul>
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.geoip-region-by-name-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">hostname</code></dt>
     <dd>
      <p class="para">
       The hostname or IP address whose region is to be looked-up.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-region-by-name-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns the associative array on success, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if the address 
   cannot be found in the database.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-region-by-name-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-3686">
    <p><strong>Beispiel #1 A <span class="function"><strong>geoip_region_by_name()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     This will print the array containing the country code and region
     of the host example.com.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$region </span><span style="color: #007700">= </span><span style="color: #0000BB">geoip_region_by_name</span><span style="color: #007700">(</span><span style="color: #DD0000">'www.example.com'</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$region</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$region</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [country_code] =&gt; US
    [region] =&gt; CA
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


</div><?php manual_footer($setup); ?>