<?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.hex2bin.php',
    1 => 'hex2bin',
    2 => 'Convertit une cha&icirc;ne encod&eacute;e en hexad&eacute;cimal vers du binaire',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res',
  ),
  'prev' => 
  array (
    0 => 'function.hebrevc.php',
    1 => 'hebrevc',
  ),
  'next' => 
  array (
    0 => 'function.html-entity-decode.php',
    1 => 'html_entity_decode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/strings/functions/hex2bin.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.hex2bin" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">hex2bin</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">hex2bin</span> &mdash; <span class="dc-title">Convertit une chaîne encodée en hexadécimal vers du binaire</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.hex2bin-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>hex2bin</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"><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 chaîne binaire encodée en hexadécimal.
  </p>
  <div class="caution"><strong class="caution">Attention</strong>
   <p class="para">
    Cette fonction ne convertit <em>PAS</em> un nombre hexadécimal
    en un nombre binaire. Cela peut être réalisé en utilisant la fonction
    <span class="function"><a href="function.base-convert.php" class="function">base_convert()</a></span>.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.hex2bin-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">string</code></dt>
    <dd>
     <p class="para">
      Représentation hexadécimale de la donnée.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.hex2bin-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la représentation binaire de la donnée  ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.hex2bin-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   Si la chaîne d&#039;entrée en hexadécimale est d&#039;une longueur impaire ou
   si la chaîne en hexadécimale est invalide, une alerte de niveau
   <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> sera émise.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.hex2bin-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="hex2bin.example.basic">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>hex2bin()</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 />$hex </span><span style="color: #007700">= </span><span style="color: #0000BB">hex2bin</span><span style="color: #007700">(</span><span style="color: #DD0000">"6578616d706c65206865782064617461"</span><span style="color: #007700">);<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">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(16) &quot;example hex data&quot;</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.hex2bin-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.bin2hex.php" class="function" rel="rdfs-seeAlso">bin2hex()</a> - Convertit des donn&eacute;es binaires en repr&eacute;sentation hexad&eacute;cimale</span></li>
    <li><span class="function"><a href="function.unpack.php" class="function" rel="rdfs-seeAlso">unpack()</a> - D&eacute;conditionne des donn&eacute;es depuis une cha&icirc;ne binaire</span></li>
   </ul>
  </p>
 </div>


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