note 102406 deleted from function.domnode-attributes by danbrown
| From: | danbrown@php.net | Date: | Sat, 12 Feb 2011 17:55:50 +0000 |
| Subject: | note 102406 deleted from function.domnode-attributes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176930@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
In response to Ian Monroe's getAttribute function:
DomAttr doesn't have name() and value() methods, those are public properties of the class.
Therefore, the correct function will be:
<?php
function getAttribute($name, $att)
{
foreach($att as $i)
{
if($i->name==$name)
return $i->value;
}
}?>