protected elementHasAttributes ( DOMNode $element, array $attributes = null ) : boolean | ||
$element | DOMNode | |
$attributes | array | array of attribute names to check (lowercase) |
return | boolean | TRUE if at least one of the $attributes is contained in the given $element, otherwise FALSE |
protected function elementHasAttributes(\DOMNode $element, array $attributes = null)
{
if ($attributes === null) {
return false;
}
/** @var $attribute \DOMAttr */
foreach ($element->attributes as $attribute) {
if (in_array(strtolower($attribute->name), $attributes)) {
return true;
}
}
return false;
}