<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.bin2hex.php',
    1 => 'bin2hex',
    2 => 'Convertit des donn&eacute;es binaires en repr&eacute;sentation hexad&eacute;cimale',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res',
  ),
  'prev' => 
  array (
    0 => 'function.addslashes.php',
    1 => 'addslashes',
  ),
  'next' => 
  array (
    0 => 'function.chop.php',
    1 => 'chop',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/strings/functions/bin2hex.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.bin2hex" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bin2hex</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">bin2hex</span> &mdash; <span class="dc-title">Convertit des données binaires en représentation hexadécimale</span></p>

 </div>

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

  <p class="para rdfs-comment">
   Retourne la chaîne <code class="parameter">string</code> dont tous les caractères
   sont représentés par leur équivalent hexadécimal. La chaîne retournée
   est une chaîne ASCII. La conversion supporte les caractères binaires,
   et utilise les bits de poids forts en premier.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.bin2hex-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Une <a href="language.types.string.php" class="link">chaîne de caractères</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.bin2hex-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la représentation hexadécimale de la chaîne fournie.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.bin2hex-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>bin2hex()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /> <br />$hex </span><span style="color: #007700">= </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #DD0000">'Hello world!'</span><span style="color: #007700">);<br /> <br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$hex</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">hex2bin</span><span style="color: #007700">(</span><span style="color: #0000BB">$hex</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(24) &quot;48656c6c6f20776f726c6421&quot;
string(12) &quot;Hello world!&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.bin2hex-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.hex2bin.php" class="function" rel="rdfs-seeAlso">hex2bin()</a> - Convertit une cha&icirc;ne encod&eacute;e en hexad&eacute;cimal vers du binaire</span></li>
    <li><span class="function"><a href="function.pack.php" class="function" rel="rdfs-seeAlso">pack()</a> - Compacte des donn&eacute;es dans une cha&icirc;ne binaire</span></li>
   </ul>
  </p>
 </div>


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