<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.recursivecallbackfilteriterator.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'recursivecallbackfilteriterator.haschildren.php',
    1 => 'RecursiveCallbackFilterIterator::hasChildren',
    2 => 'V&eacute;rifie si l\'&eacute;l&eacute;ment courant de l\'it&eacute;rateur interne a un fils',
  ),
  'up' => 
  array (
    0 => 'class.recursivecallbackfilteriterator.php',
    1 => 'RecursiveCallbackFilterIterator',
  ),
  'prev' => 
  array (
    0 => 'recursivecallbackfilteriterator.getchildren.php',
    1 => 'RecursiveCallbackFilterIterator::getChildren',
  ),
  'next' => 
  array (
    0 => 'class.recursivedirectoryiterator.php',
    1 => 'RecursiveDirectoryIterator',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/spl/recursivecallbackfilteriterator/haschildren.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="recursivecallbackfilteriterator.haschildren" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">RecursiveCallbackFilterIterator::hasChildren</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">RecursiveCallbackFilterIterator::hasChildren</span> &mdash; <span class="dc-title">Vérifie si l&#039;élément courant de l&#039;itérateur interne a un fils</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-recursivecallbackfilteriterator.haschildren-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>RecursiveCallbackFilterIterator::hasChildren</strong></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si l&#039;élément courant a un fils, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> sinon.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-recursivecallbackfilteriterator.haschildren-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">Cette fonction ne contient aucun paramètre.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-recursivecallbackfilteriterator.haschildren-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si l&#039;élément courant a des enfants, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> sinon.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-recursivecallbackfilteriterator.haschildren-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="recursivecallbackfilteriterator.haschildren.examples.basic">
    <p><strong>Exemple #1 Exemple avec <span class="methodname"><strong>RecursiveCallbackFilterIterator::hasChildren()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$dir </span><span style="color: #007700">= new </span><span style="color: #0000BB">RecursiveDirectoryIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">__DIR__</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Itération récursive sur des fichiers XML<br /></span><span style="color: #0000BB">$files </span><span style="color: #007700">= new </span><span style="color: #0000BB">RecursiveCallbackFilterIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">$dir</span><span style="color: #007700">, function (</span><span style="color: #0000BB">$current</span><span style="color: #007700">, </span><span style="color: #0000BB">$key</span><span style="color: #007700">, </span><span style="color: #0000BB">$iterator</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">// Autorise la récursion dans les dossiers<br />    </span><span style="color: #007700">if (</span><span style="color: #0000BB">$iterator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">hasChildren</span><span style="color: #007700">()) {<br />        return </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">;<br />    }<br />    </span><span style="color: #FF8000">// Vérifie le fichier XML<br />    </span><span style="color: #007700">if (!</span><span style="color: #0000BB">strcasecmp</span><span style="color: #007700">(</span><span style="color: #0000BB">$current</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">(), </span><span style="color: #DD0000">'xml'</span><span style="color: #007700">)) {<br />        return </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">;<br />    }<br />    return </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">;<br />});<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 seealso" id="refsect1-recursivecallbackfilteriterator.haschildren-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="class.recursivecallbackfilteriterator.php#recursivecallbackfilteriterator.examples" class="link">Exemples avec RecursiveCallbackFilterIterator</a></li>
    <li><span class="methodname"><a href="recursivecallbackfilteriterator.construct.php" class="methodname" rel="rdfs-seeAlso">RecursiveCallbackFilterIterator::__construct()</a> - Cr&eacute;e un objet RecursiveCallbackFilterIterator depuis une interface RecursiveIterator</span></li>
    <li><span class="methodname"><a href="recursivecallbackfilteriterator.getchildren.php" class="methodname" rel="rdfs-seeAlso">RecursiveCallbackFilteriterator::getChildren()</a> - Retourne l'it&eacute;rateur fils interne contenu dans un RecursiveCallbackFilterIterator</span></li>
   </ul>
  </p>
 </div>


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