note 46075 added to ref.dom
| From: | SG_01Lunarchild at osu1 dot php dot net | Date: | Tue, 28 Sep 2004 16:03:52 +0000 |
| Subject: | note 46075 added to ref.dom | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77534@lists.php.net to get a copy of this message | ||
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 ;)
----
Manual Page -- http://www.php.net/manual/en/ref.dom.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46075
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46075&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46075&report=yes
Search -- http://master.php.net/manage/user-notes.php