downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/fr/function.inet-ntop.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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-ntop.php',
   
1 => 'inet_ntop',
  ),
 
'up' =>
  array (
   
0 => 'ref.network.php',
   
1 => 'Fonctions réseaux',
  ),
 
'prev' =>
  array (
   
0 => 'function.headers-sent.php',
   
1 => 'headers_sent',
  ),
 
'next' =>
  array (
   
0 => 'function.inet-pton.php',
   
1 => 'inet_pton',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.inet-ntop" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">inet_ntop</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">inet_ntop</span> &mdash; <span class="dc-title">Convertit un paquet d&#039;adresses internet en une représentation humainement lisible</span></p>

 </div>

 <a name="function.inet-ntop.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><b>inet_ntop</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$in_addr</tt></span>
   )</div>

  <p class="simpara">
   Convertit une adresse 32 bit IPv4 ou 128 bit IPv6 (si PHP a été
   compilé avec le support IPv6) en une chaîne représentant une
   famille d&#039;adresses.
  </p>
 </div>


 <a name="function.inet-ntop.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">in_addr</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Une adresse 32 bit IPv4, ou 128 bit IPv6.
      </p>
     </dd>

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


 <a name="function.inet-ntop.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une représentation de l&#039;adresse, sous la forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a>,
   ou <b><tt class="constant">FALSE</tt></b> si une erreur survient.
  </p>
 </div>


 <a name="function.inet-ntop.examples"></a><div class="refsect1 examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Exemple #1 Exemple avec <b>inet_ntop()</b></b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$packed&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">127</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$expanded&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">inet_ntop</span><span style="color: #007700">(</span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Affiche&nbsp;:&nbsp;127.0.0.1&nbsp;*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$expanded</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$packed&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">str_repeat</span><span style="color: #007700">(</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">15</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$expanded&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">inet_ntop</span><span style="color: #007700">(</span><span style="color: #0000BB">$packed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Affiche&nbsp;:&nbsp;::1&nbsp;*/<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$expanded</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

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


 <a name="function.inet-ntop.changelog"></a><div class="refsect1 changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   </p><table class="doctable informaltable">
   
     <thead valign="middle">
      <tr valign="middle">
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody valign="middle" class="tbody">
      <tr valign="middle">
       <td align="left">5.3.0</td>
       <td align="left">
        Cette fonction est maintenant disponible sur les plate-formes Windows.
       </td>
      </tr>

     </tbody>
   
   </table>
<p>
  </p>
 </div>


 <a name="function.inet-ntop.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.long2ip.php" class="function" rel="rdfs-seeAlso">long2ip()</a> - Convertit une adresse IP (IPv4) en adresse IP numérique</li>
    <li class="member"><a href="function.ip2long.php" class="function" rel="rdfs-seeAlso">ip2long()</a> - Convertit une chaîne contenant une adresse (IPv4) IP numérique en adresse littérale</li>
    <li class="member"><a href="function.inet-pton.php" class="function" rel="rdfs-seeAlso">inet_pton()</a> - Convertit une adresse IP lisible en sa représentation in_addr</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites