DomElement->tagname()

(no version information, might be only in CVS)

DomElement->tagname() --  現在の要素名を返す

説明

class DomElement {

string tagname ( void )

}

現在のノードの名前を返します。この関数をコールすることは、 tagname プロパティにアクセスする、 もしくは現在のノードに対して DomNode->node_name をコールすることと等価です。

返り値

現在の DomElement ノードの名前を返します。

例 1. ノード名を取得する

<?php

include("example.inc");

if (!
$dom = domxml_open_mem($xmlstr)) {
    echo
"Error while parsing the document\n";
    exit;
}

$root = $dom->document_element();
echo
$root->tagname();   // chapter
echo $root->tagname;     // chapter
echo $root->node_name(); // chapter


?>

PHP 5 への移行

DOMElement オブジェクトの tagName プロパティを使用してください。