<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.quickhashinthash.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'quickhashinthash.loadfromstring.php',
    1 => 'QuickHashIntHash::loadFromString',
    2 => 'Cette m&eacute;thode d\'usine cr&eacute;e un hachage &agrave; partir d\'une cha&icirc;ne de caract&egrave;res',
  ),
  'up' => 
  array (
    0 => 'class.quickhashinthash.php',
    1 => 'QuickHashIntHash',
  ),
  'prev' => 
  array (
    0 => 'quickhashinthash.loadfromfile.php',
    1 => 'QuickHashIntHash::loadFromFile',
  ),
  'next' => 
  array (
    0 => 'quickhashinthash.savetofile.php',
    1 => 'QuickHashIntHash::saveToFile',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/quickhash/quickhashinthash/loadfromstring.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="quickhashinthash.loadfromstring" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">QuickHashIntHash::loadFromString</h1>
  <p class="verinfo">(PECL quickhash &gt;= Unknown)</p><p class="refpurpose"><span class="refname">QuickHashIntHash::loadFromString</span> &mdash; <span class="dc-title">Cette méthode d&#039;usine crée un hachage à partir d&#039;une chaîne de caractères</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-quickhashinthash.loadfromstring-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>QuickHashIntHash::loadFromString</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$contents</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="class.quickhashinthash.php" class="type QuickHashIntHash">QuickHashIntHash</a></span></div>

  <p class="simpara">
   Cette méthode d&#039;usine crée un nouveau hachage à partir d&#039;une définition dans une chaîne de caractères. Le
   format de fichier consiste en des entiers signés 32 bits empaquetés ensemble dans l&#039;Endianness que le système
   sur lequel le code s&#039;exécute utilise. Pour chaque élément de hachage, il y a deux entiers 32 bits signés
   stockés ensemble. Le premier de chaque élément est la clé, et le second est la valeur appartenant à la clé.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-quickhashinthash.loadfromstring-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">contents</code></dt>
    <dd>
     <span class="simpara">
      La chaîne contenant un format sérialisé du hachage.
     </span>
    </dd>
   
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <span class="simpara">
      Les mêmes options que le constructeur de la classe; à l&#039;exception de l&#039;option
      size qui est ignorée. Elle est automatiquement calculée pour être la même que le
      nombre d&#039;entrées dans le hachage, arrondie à la puissance de deux la plus proche
      avec une limite maximale de <code class="literal">4194304</code>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-quickhashinthash.loadfromstring-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="simpara">
   Renvoie un nouveau <span class="classname"><a href="class.quickhashinthash.php" class="classname">QuickHashIntHash</a></span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-quickhashinthash.loadfromstring-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple de <span class="function"><strong>QuickHashIntHash::loadFromString()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$contents </span><span style="color: #007700">= </span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">( </span><span style="color: #0000BB">dirname</span><span style="color: #007700">( </span><span style="color: #0000BB">__FILE__ </span><span style="color: #007700">) . </span><span style="color: #DD0000">"/simple.hash" </span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$hash </span><span style="color: #007700">= </span><span style="color: #0000BB">QuickHashIntHash</span><span style="color: #007700">::</span><span style="color: #0000BB">loadFromString</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">$contents</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">QuickHashIntHash</span><span style="color: #007700">::</span><span style="color: #0000BB">DO_NOT_USE_ZEND_ALLOC<br /></span><span style="color: #007700">);<br />foreach( </span><span style="color: #0000BB">range</span><span style="color: #007700">( </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0x0f </span><span style="color: #007700">) as </span><span style="color: #0000BB">$key </span><span style="color: #007700">)<br />{<br />    </span><span style="color: #0000BB">printf</span><span style="color: #007700">( </span><span style="color: #DD0000">"Key %3d (%2x) is %s\n"</span><span style="color: #007700">,<br />        </span><span style="color: #0000BB">$key</span><span style="color: #007700">, </span><span style="color: #0000BB">$key</span><span style="color: #007700">,<br />        </span><span style="color: #0000BB">$hash</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">exists</span><span style="color: #007700">( </span><span style="color: #0000BB">$key </span><span style="color: #007700">) ? </span><span style="color: #DD0000">'set' </span><span style="color: #007700">: </span><span style="color: #DD0000">'unset'<br />    </span><span style="color: #007700">);<br />}<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="examplescode"><pre class="examplescode">Key   0 ( 0) is unset
Key   1 ( 1) is set
Key   2 ( 2) is set
Key   3 ( 3) is set
Key   4 ( 4) is unset
Key   5 ( 5) is set
Key   6 ( 6) is unset
Key   7 ( 7) is set
Key   8 ( 8) is unset
Key   9 ( 9) is unset
Key  10 ( a) is unset
Key  11 ( b) is set
Key  12 ( c) is unset
Key  13 ( d) is set
Key  14 ( e) is unset
Key  15 ( f) is unset</pre>
</div>
   </div>
  </div>
 </div>



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