note 102406 added to function.domnode-attributes
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 12 Feb 2011 14:17:43 +0000 |
| Subject: | note 102406 added to function.domnode-attributes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176926@lists.php.net to get a copy of this message | ||
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;
}
}?>
----
Server IP: 69.147.83.197
Probable Submitter: 78.187.44.170
----
Manual Page -- http://www.php.net/manual/en/function.domnode-attributes.php
Edit -- https://master.php.net/note/edit/102406
Del: integrated -- https://master.php.net/note/delete/102406/integrated
Del: useless -- https://master.php.net/note/delete/102406/useless
Del: bad code -- https://master.php.net/note/delete/102406/bad+code
Del: spam -- https://master.php.net/note/delete/102406/spam
Del: non-english -- https://master.php.net/note/delete/102406/non-english
Del: in docs -- https://master.php.net/note/delete/102406/in+docs
Del: other reasons-- https://master.php.net/note/delete/102406
Reject -- https://master.php.net/note/reject/102406
Search -- https://master.php.net/manage/user-notes.php