note 47102 added to ref.dom

From: Date: Wed, 03 Nov 2004 02:36:50 +0000
Subject: note 47102 added to ref.dom
Groups: php.notes 
Request: Send a blank email to php-notes+get-79530@lists.php.net to get a copy of this message
An excellent way to get a nodes elements in php5: ( remembering to use item(n) if more than one node exists ) one node: $node = $dom->getElementsByTagname("node"); foreach( $node->item(0)->attributes as $items){ print "$items->nodeName: $items->nodeValue"; } If you wanted to search a list of the same nodes: n nodes: foreach( $dom->getElementsByTagname("node") as $item ) { foreach( $item->attributes as $attrib ){ print "$attrib->nodeName: $attrib->nodeValue"; } } ---- Manual Page -- http://www.php.net/manual/en/ref.dom.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47102 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47102&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47102&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79530) next »