Organizational Research By

Surprising Reserch Topic

in simplexml how can i add an existing simplexmlelement as a child element using -'php,oop,simplexml'


in simplexml how can i add an existing simplexmlelement as a child element  using -'php,oop,simplexml'

I have a SimpleXMLElement object $child, and a SimpleXMLElement object $parent.

How can I add $child as a child of $parent?  Is there any way of doing this without converting to DOM and back?

The addChild() method only seems to allow me to create a new, empty element, but that doesn't help when the element I want to add $child also has children.  I'm thinking I might need recursion here.
    
asked Sep 7, 2015 by rajesh
0 votes
3 views



Related Hot Questions



Government Jobs Opening


...