public getAttribute ( string | integer $attr, string $compare = 'total', boolean $case_sensitive = false ) : string | array | ||
$attr | string | integer | Negative int to count from end |
$compare | string | Find node using "namespace", "name" or "total" |
$case_sensitive | boolean | Compare with case sensitivity |
리턴 | string | array |
function getAttribute($attr, $compare = 'total', $case_sensitive = false)
{
$f = $this->findAttribute($attr, $compare, $case_sensitive);
if (is_array($f) && $f) {
if (count($f) === 1) {
return $this->attributes[$f[0][2]];
} else {
$res = array();
foreach ($f as $a) {
$res[] = $this->attributes[$a[2]];
}
return $res;
}
} else {
return null;
}
}