DOMDocument::createAttribute

(PHP 5, PHP 7)

DOMDocument::createAttributeCreate new attribute

˵��

public DOMDocument::createAttribute ( string $name ) : DOMAttr

This function creates a new instance of class DOMAttr. �˽ڵ�������ĵ��У������������� DOMNode->appendChild() �Ⱥ�����������롣

����

name

The name of the attribute.

����ֵ

The new DOMAttr or FALSE if an error occurred.

�����쳣

DOM_INVALID_CHARACTER_ERR

Raised if name contains an invalid character.

�μ�