note 78493 added to ref.xml
| From: | TeerachaiJ at GMail dot com | Date: | Mon, 15 Oct 2007 09:17:02 +0000 |
| Subject: | note 78493 added to ref.xml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131390@lists.php.net to get a copy of this message | ||
I enhance xml2array (can't remember who author) to work with duplicate key index by change
"tagData" function with this ->
<?
function tagData($parser, $tagData) {
// set the latest open tag equal to the tag data
$strEval = "\$this->arrOutput";
foreach ($this->arrName as $value) {
$strEval .= "[" . $value . "]";
$arr .= "[" . $value . "]"; //*Enhance by Tâ¢J (array when dup)
}
eval("\$x=\$this->arrOutput" . $arr . ";"); //*Enhance by Tâ¢J (array
when dup)
if($x) { $strEval = $strEval . "[" . ++$this->arrOutput[$arr] . "] =
\$tagData;"; } //*Enhance by Tâ¢J (array when dup)
else { $strEval = $strEval . " = \$tagData;"; }
eval ($strEval);
}
?>
I not sure have another do it now.
Hope!!! It will help your work.
----
Server IP: 203.121.145.99
Probable Submitter: 203.155.179.11
----
Manual Page -- http://www.php.net/manual/en/ref.xml.php
Edit -- https://master.php.net/note/edit/78493
Del: integrated -- https://master.php.net/note/delete/78493/integrated
Del: useless -- https://master.php.net/note/delete/78493/useless
Del: bad code -- https://master.php.net/note/delete/78493/bad+code
Del: spam -- https://master.php.net/note/delete/78493/spam
Del: non-english -- https://master.php.net/note/delete/78493/non-english
Del: in docs -- https://master.php.net/note/delete/78493/in+docs
Del: other reasons-- https://master.php.net/note/delete/78493
Reject -- https://master.php.net/note/reject/78493
Search -- https://master.php.net/manage/user-notes.php