array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'domelement.getattributenames.php', 1 => 'DOMElement::getAttributeNames', 2 => 'Get attribute names', ), 'up' => array ( 0 => 'class.domelement.php', 1 => 'DOMElement', ), 'prev' => array ( 0 => 'domelement.getattribute.php', 1 => 'DOMElement::getAttribute', ), 'next' => array ( 0 => 'domelement.getattributenode.php', 1 => 'DOMElement::getAttributeNode', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/dom/domelement/getattributenames.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

DOMElement::getAttributeNames

(PHP 8 >= 8.3.0)

DOMElement::getAttributeNamesGet attribute names

Опис

public DOMElement::getAttributeNames(): array

Get attribute names.

Параметри

У цієї функції немає параметрів.

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

Return attribute names.

Приклади

Приклад #1 DOMElement::getAttributeNames() example

<?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"
}