note 103268 added to book.simplexml
| From: | sdotvolkomorovatgmaildotcom at osu1 dot php dot net | Date: | Tue, 05 Apr 2011 07:01:53 +0000 |
| Subject: | note 103268 added to book.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178503@lists.php.net to get a copy of this message | ||
marcus dot garcia at uol dot com dot br posted a rather useful function, but I would change the
following lines
<?php
if(!is_array($arr[$nodeName]['value']))
{
$arr[$nodeName]['value'][] = array_shift($arr[$nodeName]);
$arr[$nodeName]['attributes'][] = array_shift($arr[$nodeName]['attributes']);
}
?>
to
<?php
if(!is_array($arr[$nodeName]['value']))
{
$arr[$nodeName]['value'][] = array_shift($arr[$nodeName]);
$arr[$nodeName]['attributes'] = Array($arr[$nodeName]['attributes']);
}
?>
because otherwise the resulting array is incorrect.
----
Server IP: 69.147.83.197
Probable Submitter: 178.177.19.121
----
Manual Page -- http://www.php.net/manual/en/book.simplexml.php
Edit -- https://master.php.net/note/edit/103268
Del: integrated -- https://master.php.net/note/delete/103268/integrated
Del: useless -- https://master.php.net/note/delete/103268/useless
Del: bad code -- https://master.php.net/note/delete/103268/bad+code
Del: spam -- https://master.php.net/note/delete/103268/spam
Del: non-english -- https://master.php.net/note/delete/103268/non-english
Del: in docs -- https://master.php.net/note/delete/103268/in+docs
Del: other reasons-- https://master.php.net/note/delete/103268
Reject -- https://master.php.net/note/reject/103268
Search -- https://master.php.net/manage/user-notes.php