note 82865 deleted from ref.xml by danbrown

From: Date: Wed, 03 Mar 2010 18:57:03 +0000
Subject: note 82865 deleted from ref.xml by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166632@lists.php.net to get a copy of this message
Note Submitter: galen dot senogles at gmail dot com ---- An update to the function below. Fixes a bug where the data of the first tag, would occasionally get appended to the beginning of the tag data of the second tag. <?php foreach($dom['child_nodes'][0]['child_nodes'] as $key => $value) { $tagname = $value['tag_name']; if(isset($value['child_nodes'][0])) { $numarrays = count($value['child_nodes']); if($numarrays > 1) { $contents = ""; foreach($value['child_nodes'] as $key => $value2) { $contents .= $value2; } }else { $contents = $value['child_nodes'][0]; } }else { $contents = 'isempty'; } $artmp = array($tagname => $contents); array_push_associative($xmlarray,$artmp); unset($artmp); } ?>

« previous php.notes (#166632) next »