note 78493 deleted from ref.xml by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Mar 2010 18:55:48 +0000 |
| Subject: | note 78493 deleted from ref.xml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166623@lists.php.net to get a copy of this message | ||
Note Submitter: TeerachaiJ at GMail dot com
----
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.