<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.geoip-record-by-name.php',
    1 => 'geoip_record_by_name',
    2 => 'Returns the detailed City information found in the GeoIP Database',
  ),
  'up' => 
  array (
    0 => 'ref.geoip.php',
    1 => 'GeoIP Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.geoip-org-by-name.php',
    1 => 'geoip_org_by_name',
  ),
  'next' => 
  array (
    0 => 'function.geoip-region-by-name.php',
    1 => 'geoip_region_by_name',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/geoip/functions/geoip-record-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-record-by-name" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_record_by_name</h1>
  <p class="verinfo">(PECL geoip &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">geoip_record_by_name</span> &mdash; <span class="dc-title">Returns the detailed City information found in the GeoIP Database</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-record-by-name-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_record_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="simpara">
   The <span class="function"><strong>geoip_record_by_name()</strong></span> function will return the
   record information corresponding to a hostname or an IP address.
  </p>
  <p class="simpara">
   This function is available for both GeoLite City Edition and commercial GeoIP
   City Edition. A warning will be issued if the proper database cannot be
   located.
  </p>
  <p class="simpara">
   The names of the different keys of the returning associative array are as follows:
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     &quot;continent_code&quot; -- Two letter continent code (as of version 1.0.4 with
     libgeoip 1.4.3 or newer)
    </span>
   </li>
   <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;country_code3&quot; -- Three letter country code (see
     <span class="function"><a href="function.geoip-country-code3-by-name.php" class="function">geoip_country_code3_by_name()</a></span>)
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;country_name&quot; -- The country name (see
     <span class="function"><a href="function.geoip-country-name-by-name.php" class="function">geoip_country_name_by_name()</a></span>)
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;region&quot; -- The region code (ex: CA for California)
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;city&quot; -- The city.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;postal_code&quot; -- The Postal Code, FSA or Zip Code.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;latitude&quot; -- The Latitude as signed <span class="type"><a href="language.types.float.php" class="type float">float</a></span>.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;longitude&quot; -- The Longitude as signed <span class="type"><a href="language.types.float.php" class="type float">float</a></span>.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;dma_code&quot; -- Designated Market Area code (USA and Canada only)
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     &quot;area_code&quot; -- The PSTN area code (ex: 212)
    </span>
   </li>
  </ul>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.geoip-record-by-name-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">hostname</code></dt>
    <dd>
     <span class="simpara">
      The hostname or IP address whose record is to be looked-up.
     </span>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-record-by-name-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   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 changelog" id="refsect1-function.geoip-record-by-name-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL geoip 1.0.4</td>
      <td>
       Adding the continent_code with GeoIP Library 1.4.3 or newer only
      </td>
     </tr>

     <tr>
      <td>PECL geoip 1.0.3</td>
      <td>
       Adding country_code3 and country_name
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-record-by-name-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 A <span class="function"><strong>geoip_record_by_name()</strong></span> example</strong></p>
   <div class="example-contents"><p>
    This will print the array containing the record of host example.com.
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$record </span><span style="color: #007700">= </span><span style="color: #0000BB">geoip_record_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">$record</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$record</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [continent_code] =&gt; NA
    [country_code] =&gt; US
    [country_code3] =&gt; USA
    [country_name] =&gt; United States
    [region] =&gt; CA
    [city] =&gt; Marina Del Rey
    [postal_code] =&gt;
    [latitude] =&gt; 33.9776992798
    [longitude] =&gt; -118.435096741
    [dma_code] =&gt; 803
    [area_code] =&gt; 310
)</pre>
</div>
   </div>
  </div>
 </div>


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