<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.simplexmlelement.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'simplexmlelement.getchildren.php',
    1 => 'SimpleXMLElement::getChildren',
    2 => 'Returns the sub-elements of the current element',
  ),
  'up' => 
  array (
    0 => 'class.simplexmlelement.php',
    1 => 'SimpleXMLElement',
  ),
  'prev' => 
  array (
    0 => 'simplexmlelement.getnamespaces.php',
    1 => 'SimpleXMLElement::getNamespaces',
  ),
  'next' => 
  array (
    0 => 'simplexmlelement.haschildren.php',
    1 => 'SimpleXMLElement::hasChildren',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/simplexml/simplexmlelement/getchildren.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="simplexmlelement.getchildren" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SimpleXMLElement::getChildren</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">SimpleXMLElement::getChildren</span> &mdash; <span class="dc-title">Returns the sub-elements of the current element</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-simplexmlelement.getchildren-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SimpleXMLElement::getChildren</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.simplexmlelement.php" class="type SimpleXMLElement">SimpleXMLElement</a></span></span></div>


  <div class="warning"><strong class="warning">Avviso</strong>
   <p class="simpara">
    Prior to PHP 8.0, <span class="methodname"><strong>SimpleXMLElement::getChildren()</strong></span> was only
    declared on the subclass <span class="classname"><a href="class.simplexmliterator.php" class="classname">SimpleXMLIterator</a></span>.
   </p>
  </div>

  <p class="para">
   This method returns a <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span> object
   containing sub-elements of the current <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span>
   element.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-simplexmlelement.getchildren-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">Questa funzione non contiene parametri.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-simplexmlelement.getchildren-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns a <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span> object containing
   the sub-elements of the current element.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-simplexmlelement.getchildren-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Return the sub-elements of the current element</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$xml </span><span style="color: #007700">= &lt;&lt;&lt;XML<br /></span><span style="color: #DD0000">&lt;books&gt;<br />    &lt;book&gt;<br />        &lt;title&gt;PHP Basics&lt;/title&gt;<br />        &lt;author&gt;Jim Smith&lt;/author&gt;<br />    &lt;/book&gt;<br />    &lt;book&gt;XML basics&lt;/book&gt;<br />&lt;/books&gt;<br /></span><span style="color: #007700">XML;<br /><br /></span><span style="color: #0000BB">$xmlElement </span><span style="color: #007700">= new </span><span style="color: #0000BB">SimpleXMLElement</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml</span><span style="color: #007700">);<br />for (</span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rewind</span><span style="color: #007700">(); </span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">valid</span><span style="color: #007700">(); </span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">()) {<br />    foreach(</span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getChildren</span><span style="color: #007700">() as </span><span style="color: #0000BB">$name </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$data</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"The </span><span style="color: #0000BB">$name</span><span style="color: #DD0000"> is '</span><span style="color: #0000BB">$data</span><span style="color: #DD0000">' from the class " </span><span style="color: #007700">. </span><span style="color: #0000BB">get_class</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />    }<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">The title is &#039;PHP Basics&#039; from the class SimpleXMLElement
The author is &#039;Jim Smith&#039; from the class SimpleXMLElement</pre>
</div>
    </div>
   </div>
  </p>
 </div>


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