note 103263 added to book.simplexml
| From: | soylent17 at osu1 dot php dot net | Date: | Mon, 04 Apr 2011 21:13:19 +0000 |
| Subject: | note 103263 added to book.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178495@lists.php.net to get a copy of this message | ||
marcus dot garcia at uol dot com dot br
You have a bit of an error in your code:
<?php
if(!is_array($arr[$nodeName]['value'])) {
$arr[$nodeName]['value'][] = array_shift($arr[$nodeName]);
$arr[$nodeName]['attributes'][] = array_shift($arr[$nodeName]['attributes']);
}
?>
should be:
<?php
if(!is_array($arr[$nodeName]['value'])) {
$arr[$nodeName]['value'] = array($arr[$nodeName]['value']);
$arr[$nodeName]['attributes'] = array($arr[$nodeName]['attributes']);
}
?>
(php tags added for color coding)
----
Server IP: 69.147.83.197
Probable Submitter: 96.47.200.219
----
Manual Page -- http://www.php.net/manual/en/book.simplexml.php
Edit -- https://master.php.net/note/edit/103263
Del: integrated -- https://master.php.net/note/delete/103263/integrated
Del: useless -- https://master.php.net/note/delete/103263/useless
Del: bad code -- https://master.php.net/note/delete/103263/bad+code
Del: spam -- https://master.php.net/note/delete/103263/spam
Del: non-english -- https://master.php.net/note/delete/103263/non-english
Del: in docs -- https://master.php.net/note/delete/103263/in+docs
Del: other reasons-- https://master.php.net/note/delete/103263
Reject -- https://master.php.net/note/reject/103263
Search -- https://master.php.net/manage/user-notes.php