<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.array.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.array-merge-recursive.php',
    1 => 'array_merge_recursive',
    2 => 'Combine un ou plusieurs tableaux ensemble, r&eacute;cursivement',
  ),
  'up' => 
  array (
    0 => 'ref.array.php',
    1 => 'Fonctions sur les tableaux',
  ),
  'prev' => 
  array (
    0 => 'function.array-merge.php',
    1 => 'array_merge',
  ),
  'next' => 
  array (
    0 => 'function.array-multisort.php',
    1 => 'array_multisort',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/array/functions/array-merge-recursive.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.array-merge-recursive" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">array_merge_recursive</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">array_merge_recursive</span> &mdash; <span class="dc-title">Combine un ou plusieurs tableaux ensemble, récursivement</span></p>

 </div>

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

  <p class="para rdfs-comment">
   <span class="function"><strong>array_merge_recursive()</strong></span> rassemble les
   éléments de deux ou plusieurs tableaux ensemble, en ajoutant les
   éléments de l&#039;un à la suite des éléments du précédent.
  </p>
  <p class="para">
   Si les tableaux passés en arguments ont les mêmes clés
   (chaînes de caractères), les valeurs sont alors
   rassemblées dans un tableau, de manière récursive,
   de façon à ce que, si l&#039;une de ces valeurs est un tableau
   elle-même, la fonction la rassemblera avec les valeurs de
   l&#039;entrée courante. Cependant, si deux tableaux ont la même
   clé numérique, la dernière valeur n&#039;écrasera
   pas la précédente, mais sera ajoutée à la fin
   du tableau.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.array-merge-recursive-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">arrays</code></dt>
     <dd>
      <p class="para">
       Liste variable de tableaux à rassembler récursivement.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.array-merge-recursive-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Un tableau de valeurs résultantes de la fusion des arguments.
   Si appelé sans arguments, retourne un <a href="language.types.array.php" class="link">tableau</a> vide.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.array-merge-recursive-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.4.0</td>
       <td>
        Cette fonction peut désormais être appelée sans paramètres. 
        Auparavant, au moins un paramètre était requis.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.array-merge-recursive-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>array_merge_recursive()</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 />$ar1 </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"color" </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">"favorite" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"red"</span><span style="color: #007700">), </span><span style="color: #0000BB">5</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$ar2 </span><span style="color: #007700">= array(</span><span style="color: #0000BB">10</span><span style="color: #007700">, </span><span style="color: #DD0000">"color" </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">"favorite" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"green"</span><span style="color: #007700">, </span><span style="color: #DD0000">"blue"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">array_merge_recursive</span><span style="color: #007700">(</span><span style="color: #0000BB">$ar1</span><span style="color: #007700">, </span><span style="color: #0000BB">$ar2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</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">Array
(
    [color] =&gt; Array
        (
            [favorite] =&gt; Array
                (
                    [0] =&gt; red
                    [1] =&gt; green
                )

            [0] =&gt; blue
        )

    [0] =&gt; 5
    [1] =&gt; 10
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.array-merge-recursive-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.array-merge.php" class="function" rel="rdfs-seeAlso">array_merge()</a> - Fusionne plusieurs tableaux en un seul</span></li>
    <li><span class="function"><a href="function.array-replace-recursive.php" class="function" rel="rdfs-seeAlso">array_replace_recursive()</a> - Remplace r&eacute;cursivement dans le premier tableau les &eacute;l&eacute;ments des autres tableaux fournis</span></li>
   </ul>
  </p>
 </div>

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