note 76943 added to function.simplexml-element-addAttribute

From: Date: Tue, 07 Aug 2007 10:33:06 +0000
Subject: note 76943 added to function.simplexml-element-addAttribute
Groups: php.notes 
Request: Send a blank email to php-notes+get-129243@lists.php.net to get a copy of this message
This part of the example is wrong. $sxe->addAttribute('type', 'documentary'); Think it should be like this. $sxe = new SimpleXMLElement($xmlstr); $movie = $sxe->addChild('movie'); $movie->addAttribute('type', 'documentary'); $movie->addChild('title', 'PHP2: More Parser Stories'); $movie->addChild('plot', 'This is all about the people who make it work.'); :) ---- Server IP: 87.124.64.96 Probable Submitter: 86.153.49.151 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-addAttribute.php Edit -- https://master.php.net/note/edit/76943 Del: integrated -- https://master.php.net/note/delete/76943/integrated Del: useless -- https://master.php.net/note/delete/76943/useless Del: bad code -- https://master.php.net/note/delete/76943/bad+code Del: spam -- https://master.php.net/note/delete/76943/spam Del: non-english -- https://master.php.net/note/delete/76943/non-english Del: in docs -- https://master.php.net/note/delete/76943/in+docs Del: other reasons-- https://master.php.net/note/delete/76943 Reject -- https://master.php.net/note/reject/76943 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129243) next »