API15

JSimpleXMLElement/removeChild: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
No edit summary
m removing red link to edit, no existant pages
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JSimpleXMLElement/removeChild|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JSimpleXMLElement/removeChild}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 49: Line 48:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JSimpleXMLElement/removeChild|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JSimpleXMLElement/removeChild}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 64: Line 63:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Revision as of 18:50, 12 May 2013

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

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

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);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />