note 53863 added to ref.xml

From: Date: Wed, 15 Jun 2005 15:38:30 +0000
Subject: note 53863 added to ref.xml
Groups: php.notes 
Request: Send a blank email to php-notes+get-90472@lists.php.net to get a copy of this message
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! ---- Manual Page -- http://www.php.net/manual/en/ref.xml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53863 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53863&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53863&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53863&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53863&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53863&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53863&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#90472) next »