note 46075 deleted from ref.dom by didou
| From: | didou@php.net | Date: | Sat, 02 Apr 2005 20:42:50 +0000 |
| Subject: | note 46075 deleted from ref.dom by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-87362@lists.php.net to get a copy of this message | ||
Note Submitter: SG_01 Lunarchild
----
Re: dn at NOSPAM dot xbe dot ch
- there seems to be no easy way get an array of all available attributes of a given node/element. i
didn't find it here nor in the w3c dom2 specification.
---------------------
Here's a function that might help ya:
<?php
function GetElementArray($Node) {
$arrOut = Array();
$cNode = $Node->firstChild;
while ($cNode->nextSibling != NULL) {
$arrOut[] = $cNode;
$cNode = $cNode->nextSibling;
}
return $arrOut;
}
?>
Also you might try using an xpath query and getting a nodelist which basicaly is an array ;)