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

DOMElement::getAttribute

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Returns value of attribute

Description

DOMElement::getAttribute(string $qualifiedName): string

Gets the value of the attribute with name qualifiedName for the current node.

Parameters

qualifiedName

The name of the attribute.

Return Values

The value of the attribute, or an empty string if no attribute with the given qualifiedName is found.

See Also

  • DOMElement::hasAttribute
  • DOMElement::setAttribute
  • DOMElement::removeAttribute

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