php8.5
Home/ Manual/ dom / domelement/ DOMElement::hasAttribute

DOMElement::hasAttribute

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Checks to see if attribute exists

Description

DOMElement::hasAttribute(string $qualifiedName): bool

Indicates whether attribute named qualifiedName exists as a member of the element.

Parameters

qualifiedName

The attribute name.

Return Values

Success

See Also

  • DOMElement::hasAttributeNS
  • DOMElement::getAttribute
  • DOMElement::setAttribute
  • DOMElement::removeAttribute

Source: reference/dom/domelement/hasattribute.xml · from the official PHP manual (php/doc-en)