API15

Difference between revisions of "JSimpleXMLElement/removeChild"

From Joomla! Documentation

< API15:JSimpleXMLElement
(New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JSimpleXML...)
 
Line 15: Line 15:
 
!Description
 
!Description
 
|-
 
|-
|  
+
| &$child
 
|  
 
|  
 
|   
 
|   

Revision as of 12:40, 25 March 2010

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

[Edit Descripton]

Template:Description:JSimpleXMLElement/removeChild

Syntax[edit]

removeChild(&$child)
Parameter Name Default Value Description
&$child

Defined in[edit]

libraries/joomla/utilities/simplexml.php

Importing[edit]

jimport( 'joomla.utilities.simplexml' );

Source Body[edit]

function removeChild(&$child)
{
        $name = $child->name();
        for ($i=0,$n=count($this->_children);$i<$n;$i++)
        {
                if ($this->_children[$i] == $child) {
                        unset($this->_children[$i]);
                }
        }
        for ($i=0,$n=count($this->{$name});$i<$n;$i++)
        {
                if ($this->{$name}[$i] == $child) {
                        unset($this->{$name}[$i]);
                }
        }
        $this->_children = array_values($this->_children);
        $this->{$name} = array_values($this->{$name});
        unset($child);
}

[Edit See Also] Template:SeeAlso:JSimpleXMLElement/removeChild

Examples[edit]

<CodeExamplesForm />