DOM

Hi all,

I’m not sure what is the different of $dom->createElement() & $dom->createTextNode(), please see below codes, they output the same result , so i’m not understand what’s the different, thanks. :slight_smile:

[php]
$title = $dom->createElement(“title”,“php|architect’s Guide to PHP Design Patterns”);
$book->appendChild($title);
[/php]

[php]
$title = $dom->createElement(“title”);
$text = $dom->createTextNode(“php|architect’s Guide to PHP Design Patterns”);
$title->appendChild($text);
$book->appendChild($title);
[/php]

Brgds/Brandon Chau

Sponsor our Newsletter | Privacy Policy | Terms of Service