<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.network.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.inet-pton.php',
    1 => 'inet_pton',
    2 => 'Convertit une adresse IP lisible en sa repr&eacute;sentation in_addr',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'Fonctions r&eacute;seaux',
  ),
  'prev' => 
  array (
    0 => 'function.inet-ntop.php',
    1 => 'inet_ntop',
  ),
  'next' => 
  array (
    0 => 'function.ip2long.php',
    1 => 'ip2long',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/network/functions/inet-pton.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.inet-pton" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">inet_pton</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">inet_pton</span> &mdash; <span class="dc-title">Convertit une adresse IP lisible en sa représentation in_addr</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.inet-pton-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>inet_pton</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$ip</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Convertit une adresse IPv4 ou IPv6 (si PHP a été compilé avec le
   support IPv6) humainement lisible en une structure binaire
   appropriée de famille d&#039;adresses 32 bit ou 128 bit.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.inet-pton-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ip</code></dt>
     <dd>
      <p class="para">
       Une adresse IPv4 ou IPv6.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.inet-pton-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la représentation <code class="literal">in_addr</code> de l&#039;adresse
   fournie par le paramètre <code class="parameter">ip</code> ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   si le paramètre <code class="parameter">ip</code> fourni a une syntaxe
   invalide (par exemple, une adresse IPv4 sans point, ou une adresse
   IPv6 sans deux-points).
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.inet-pton-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>inet_pton()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$in_addr </span><span style="color: #007700">= </span><span style="color: #0000BB">inet_pton</span><span style="color: #007700">(</span><span style="color: #DD0000">'127.0.0.1'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$in6_addr </span><span style="color: #007700">= </span><span style="color: #0000BB">inet_pton</span><span style="color: #007700">(</span><span style="color: #DD0000">'::1'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.inet-pton-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ip2long.php" class="function" rel="rdfs-seeAlso">ip2long()</a> - Convertit une cha&icirc;ne contenant une adresse (IPv4) en notation d&eacute;cimale &agrave; point en une adresse entier long</span></li>
    <li><span class="function"><a href="function.long2ip.php" class="function" rel="rdfs-seeAlso">long2ip()</a> - Convertit une adresse entier long (IPv4) en sa notation d&eacute;cimale &agrave; point</span></li>
    <li><span class="function"><a href="function.inet-ntop.php" class="function" rel="rdfs-seeAlso">inet_ntop()</a> - Convertit un paquet d'adresses internet en une repr&eacute;sentation humainement lisible</span></li>
   </ul>
  </p>
 </div>


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