note 94940 added to book.simplexml
| From: | Dannyfromholland at osu1 dot php dot net | Date: | Thu, 03 Dec 2009 13:58:30 +0000 |
| Subject: | note 94940 added to book.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163533@lists.php.net to get a copy of this message | ||
I tested all the scripts ive found on this page but none of them wasnt working.
ive made an new script that will work and wont get any memory errors with big xml feeds
<?php
print "<pre>";
$root = simplexml_load_string($XML_URL);
$data = get_object_vars($root);
$producten = array();
foreach ($data['product'] as $keys => $values) {
$producten['product'][$keys] = get_object_vars($data['product']);
foreach ($values as $key => $value) {
$value = str_replace("\r\n", '<br />', $value);
$value = str_replace("\r", '<br />', $value);
$value = str_replace("\n", '<br />', $value);
$producten['product'][$keys][$key] = $value;
}
}
print_R($producten);
print "</pre>";
?>
----
Server IP: 69.147.83.197
Probable Submitter: 86.83.32.95
----
Manual Page -- http://www.php.net/manual/en/book.simplexml.php
Edit -- https://master.php.net/note/edit/94940
Del: integrated -- https://master.php.net/note/delete/94940/integrated
Del: useless -- https://master.php.net/note/delete/94940/useless
Del: bad code -- https://master.php.net/note/delete/94940/bad+code
Del: spam -- https://master.php.net/note/delete/94940/spam
Del: non-english -- https://master.php.net/note/delete/94940/non-english
Del: in docs -- https://master.php.net/note/delete/94940/in+docs
Del: other reasons-- https://master.php.net/note/delete/94940
Reject -- https://master.php.net/note/reject/94940
Search -- https://master.php.net/manage/user-notes.php