note 81644 rejected from function.dom-domnamednodemap-item by nlopess
| From: | nlopess@php.net | Date: | Fri, 07 Mar 2008 19:36:53 +0000 |
| Subject: | note 81644 rejected from function.dom-domnamednodemap-item by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136829@lists.php.net to get a copy of this message | ||
Note Submitter: reyjacobs at yahoo dot com
----
Please provide an example of how I can loop
through all the attributes of an element
without knowing their names.
Like if I am looking at an element that is
<a href='yahoo.com' id='y1' title='go to
yahoo'>yahoo.com</a>
How can I get the attribute values without
specifically calling something like,
$element->attributes->getNamedItem('href')->nodeValue
$element->attributes->getNamedItem('id')->nodeValue
$element->attributes->getNamedItem('title')->nodeValue
How do you loop through the attribute and use attributes->item($z) to get the attributes?