note 80716 added to function.simplexml-element-addChild
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 30 Jan 2008 01:11:51 +0000 |
| Subject: | note 80716 added to function.simplexml-element-addChild | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135572@lists.php.net to get a copy of this message | ||
Object cloning ...
So using the 'clone' keyword here lets you work on $new separately, and attributes added
to $new don't show up in $sxe
without the 'clone' all changes to $new will be reflected in the larger $sxe tree
$new = clone $sxe->AddChild("comment",$comment);
$new->AddAttribute("name",$name);
$new->AddAttribute("url",$url);
$new->AddAttribute("ip",$ip);
$new->AddAttribute("time",$time);
----
Server IP: 193.95.141.37
Probable Submitter: 86.43.88.90
----
Manual Page -- http://www.php.net/manual/en/function.simplexml-element-addChild.php
Edit -- https://master.php.net/note/edit/80716
Del: integrated -- https://master.php.net/note/delete/80716/integrated
Del: useless -- https://master.php.net/note/delete/80716/useless
Del: bad code -- https://master.php.net/note/delete/80716/bad+code
Del: spam -- https://master.php.net/note/delete/80716/spam
Del: non-english -- https://master.php.net/note/delete/80716/non-english
Del: in docs -- https://master.php.net/note/delete/80716/in+docs
Del: other reasons-- https://master.php.net/note/delete/80716
Reject -- https://master.php.net/note/reject/80716
Search -- https://master.php.net/manage/user-notes.php