note 53863 deleted from ref.xml by bjori
| From: | bjori@php.net | Date: | Mon, 09 Oct 2006 11:13:58 +0000 |
| Subject: | note 53863 deleted from ref.xml by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118291@lists.php.net to get a copy of this message | ||
Note Submitter: matt [at] tux dot appstate dot edu
----
I was looking all over a simple parser. Thanks!
Here is my addition. I wanted something a little easier to parse. Hope it is useful to someone else.
function parseAgain(&$arr_vals) {
while (@$xml_val = array_shift($arr_vals)) {
extract($xml_val);
if ($type == 'close') {
return $new_val;
} elseif ($type == 'cdata') {
continue;
} elseif ($type == 'complete') {
$insert = array('tag'=> $tag, 'value'=> $value);
} else {
$insert = array('tag'=> $tag, 'value' => subvalue($arr_vals));
}
$new_val[] = $insert;
}
return $new_val;
}
Just send it the result from the xml2php function.
Cheers!