downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DomNode::add_namespace> <DomElement::set_attribute
[edit] Last updated: Fri, 25 May 2012

view this page in

DomElement::tagname

(PHP 4 >= 4.1.0)

DomElement::tagname 現在の要素名を返す

説明

string DomElement::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 プロパティを使用してください。



add a note add a note User Contributed Notes DomElement::tagname
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites