SimpleXML
Posted: Fri Jul 28, 2006 2:27 pm
feyd | Please use
does nothing... Does anyone know what I'm doing wrong?
Greetz,
Vincent
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I've got a problem:Code: Select all
$xmlstr = <<<XML
<?xml version='1.0' standalone='yes'?>
<root>
<element>Element1</element>
<element>Element2</element>
</root>
XML;
$sxe = new SimpleXMLElement($xmlstr);
$sxe->addChild("test", "Test!!!");
echo nl2br(str_replace(array("<", ">"), array("<", ">"), $sxe->asXML()));Greetz,
Vincent
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]