PHP SimpleXML get innerXML
function SimpleXMLElement_innerXML($xml) { $innerXML= ”; foreach (dom_import_simplexml($xml)->childNodes as $child) { $innerXML .= $child->ownerDocument->saveXML( $child ); } return $innerXML; };
function SimpleXMLElement_innerXML($xml) { $innerXML= ”; foreach (dom_import_simplexml($xml)->childNodes as $child) { $innerXML .= $child->ownerDocument->saveXML( $child ); } return $innerXML; };
I wanted to see which of these suggested solutions performed best, so I ran some comparative tests. Out of interest, I also compared the LINQ methods to the plain old System.Xml method suggested by Greg. The variation was interesting and not what I expected, with the slowest methods being more than 3 times slower than … Read more