note 42692 added to function.simplexml-element-attributes
| From: | inge at elektronaut dot no | Date: | Wed, 26 May 2004 14:53:58 +0000 |
| Subject: | note 42692 added to function.simplexml-element-attributes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70120@lists.php.net to get a copy of this message | ||
here's a simple function to get an attribute by name, based on the example
<?php
function findAttribute($object, $attribute) {
foreach($object->attributes() as $a => $b) {
if ($a == $attribute) {
$return = $b;
}
}
if($return) {
return $return;
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.simplexml-element-attributes.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42692
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42692&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42692&report=yes
Search -- http://master.php.net/manage/user-notes.php