The addChild() function adds a child element to the SimpleXML element.
public SimpleXMLElement SimpleXMLElement::addChild ( string $name [, string $value [, string $namespace ]] )
Adds a child element to the node and returns a SimpleXMLElement of the child.
Parameter | Description |
---|---|
name | The name of the child element to add. |
value | If specified, the value of the child element. |
namespace | If specified, the namespace to which the child element belongs. |
The addChild method returns a SimpleXMLElement object representing the child added to the XML node.