DOMDocument::createAttribute

(PHP 5, PHP 7, PHP 8)

DOMDocument::createAttributeCreate new attribute

Опис

public DOMDocument::createAttribute(string $localName): DOMAttr|false

This function creates a new instance of class DOMAttr. Цей вузол не відображатиметься в документі, якщо його не буде вставлено (напр.) функцією DOMNode::appendChild().

Параметри

localName

The name of the attribute.

Значення, що повертаються

The new DOMAttr or false if an error occurred.

Помилки/виключення

DOM_INVALID_CHARACTER_ERR

Raised if localName contains an invalid character.

Прогляньте також