JSimpleXMLElement/removeChild: Difference between revisions
From Joomla! Documentation
New page:
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JSimpleXML... |
(No difference)
|
Revision as of 22:56, 22 March 2010
Template:Description:JSimpleXMLElement/removeChild
Syntax
removeChild(&$child)
Parameter Name | Default Value | Description |
---|---|---|
Defined in
libraries/joomla/utilities/simplexml.php
Importing
jimport( 'joomla.utilities.simplexml' );
Source Body
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
<CodeExamplesForm />