note 58401 deleted from ref.xml by bjori
| From: | bjori@php.net | Date: | Mon, 09 Oct 2006 10:53:21 +0000 |
| Subject: | note 58401 deleted from ref.xml by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118244@lists.php.net to get a copy of this message | ||
Note Submitter: zacheryph at gmail dot com
----
@aerik
thanks a lot for this simple to use function.
@adrianus
i noticed this too as soon as i used it but it is easily resolved.
if anyone is using aerik's xml2array() (below) and noticed it doesn't play with with
multiple nodes of the same name, here is a fix.
this was only briefly tested. if anyone notices a problem with it please tell me.
<?
// replace $ReElements with the following:
// note: only addition is changing (.*) to (.*?) causing the search
// to stop at the first instance of </$1>
// change
$ReElements = '/<(\w+)\s*([^\/>]*)\s*(?:\/>|>(.*)<\/\s*\\1\s*>)/s';
// to -->
$ReElements = '/<(\w+)\s*([^\/>]*)\s*(?:\/>|>(.*?)<\/\s*\\1\s*>)/s';
?>