Statement on glibc/iconv Vulnerability

DOMElement::getAttributeNames

(PHP 8 >= 8.3.0)

DOMElement::getAttributeNames属性の名前を取得する

説明

public DOMElement::getAttributeNames(): array

属性の名前を取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

属性の名前を返します。

例1 DOMElement::getAttributeNames() の例

<?php

$dom
= new DOMDocument();
$dom->loadXML('<html xmlns:some="some:ns" some:test="a" test2="b"/>');
var_dump($dom->documentElement->getAttributeNames());
?>

上の例の出力は以下となります。

array(3) {
 [0]=>
 string(10) "xmlns:some"
 [1]=>
 string(9) "some:test"
 [2]=>
 string(5) "test2"
}
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top