note 37208 added to function.domnode-dump-node

From: Date: Thu, 06 Nov 2003 19:19:50 +0000
Subject: note 37208 added to function.domnode-dump-node
Groups: php.notes 
Request: Send a blank email to php-notes+get-60015@lists.php.net to get a copy of this message
Here is a handy little function for dumping the contents of a element node when you do not want the element itself yet you do not want the output escaped. For example, you have an HTML body tag and you want to dump the children, but you do not want all the children HTML tags escaped, which it seems like the get value/content functions do. There might be a better way of doing this, but this is pretty stable. function dump_child_nodes($node){ $owner_document = $node->owner_document(); $children = $node->child_nodes(); $total_children = count($children); for ($i = 0; $i < $total_children; $i++){ $cur_child_node = $children[$i]; $output .= $owner_document->dump_node($cur_child_node); } return $output; } Blaine Garrett Webmaster of Art Attack http://artattack.to ---- Manual Page -- http://www.php.net/manual/en/function.domnode-dump-node.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37208 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37208&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37208&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60015) next »