DOMElement::hasAttribute
(PHP 5, PHP 7)
DOMElement::hasAttribute — 属性が存在するかどうかを調べる
説明
public DOMElement::hasAttribute
( string $name
) : bool
要素のメンバとして name
という名前の属性が
存在するかどうかを示します。
パラメータ
name
- 要素名。
返り値
成功した場合に true
を、失敗した場合に false
を返します。
参考
- DOMElement::hasAttributeNS() - 属性が存在するかどうかを調べる
- DOMElement::getAttribute() - 属性の値を返す
- DOMElement::setAttribute() - 新しい属性を追加する
- DOMElement::removeAttribute() - 属性を削除する