note 76942 added to function.simplexml-element-addAttribute

From: Date: Tue, 07 Aug 2007 10:32:38 +0000
Subject: note 76942 added to function.simplexml-element-addAttribute
Groups: php.notes 
Request: Send a blank email to php-notes+get-129242@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/76942 Del: integrated -- https://master.php.net/note/delete/76942/integrated Del: useless -- https://master.php.net/note/delete/76942/useless Del: bad code -- https://master.php.net/note/delete/76942/bad+code Del: spam -- https://master.php.net/note/delete/76942/spam Del: non-english -- https://master.php.net/note/delete/76942/non-english Del: in docs -- https://master.php.net/note/delete/76942/in+docs Del: other reasons-- https://master.php.net/note/delete/76942 Reject -- https://master.php.net/note/reject/76942 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129242) next »