note 47102 deleted from ref.dom by didou
| From: | didou@php.net | Date: | Sat, 02 Apr 2005 20:44:26 +0000 |
| Subject: | note 47102 deleted from ref.dom by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-87364@lists.php.net to get a copy of this message | ||
Note Submitter: checksum at checksum.net.nz
----
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";
}
}