DOMElement::setAttributeNodeNS
(PHP 5, PHP 7, PHP 8)
DOMElement::setAttributeNodeNS — Adds new attribute node to element
说明
Adds new attribute node attr
to element, keeping the namespace into account.
If an attribute with the same name already exists on the element, that attribute is replaced by attr
.
参数
attr
-
The attribute node.
返回值
Returns the old attribute if it has been replaced or null
if there was no old attribute.
If a DOM_WRONG_DOCUMENT_ERR
error is raised, and strictErrorChecking is false
, false
is returned.
参见
- DOMElement::hasAttributeNS() - Checks to see if attribute exists
- DOMElement::getAttributeNodeNS() - Returns attribute node
- DOMElement::removeAttributeNode() - Removes attribute
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/domelement.setattributenodens.php