note 106500 added to class.simplexmlelement

From: Date: Mon, 14 Nov 2011 20:34:33 +0000
Subject: note 106500 added to class.simplexmlelement
Groups: php.notes 
Request: Send a blank email to php-notes+get-184439@lists.php.net to get a copy of this message
Warning to anyone trying to parse XML with a key name that includes a hyphen ie.) <subscribe> <callback-url>example url</callback-url> </subscribe> In order to access the callback-url you will need to do something like the following: <?php $xml = simplexml_load_string($input); $callback = $xml->{"callback-url"}; ?> If you attempt to do it without the curly braces and quotes you will find out that you are returned a 0 instead of what you want. ---- Server IP: 69.147.83.197 Probable Submitter: 174.31.48.48 ---- Manual Page -- http://www.php.net/manual/en/class.simplexmlelement.php Edit -- https://master.php.net/note/edit/106500 Del: integrated -- https://master.php.net/note/delete/106500/integrated Del: useless -- https://master.php.net/note/delete/106500/useless Del: bad code -- https://master.php.net/note/delete/106500/bad+code Del: spam -- https://master.php.net/note/delete/106500/spam Del: non-english -- https://master.php.net/note/delete/106500/non-english Del: in docs -- https://master.php.net/note/delete/106500/in+docs Del: other reasons-- https://master.php.net/note/delete/106500 Reject -- https://master.php.net/note/reject/106500 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184439) next »