downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<DomElement->set_attribute()DomNode->add_namespace>
Last updated: Thu, 26 Jun 2008

DomElement->tagname()

(No version information available, might be only in CVS)

DomElement->tagname() — Returns the name of the current element

Description

DomElement
string tagname ( void )

Returns the name of the current node. Calling this function is the same as accessing the tagname property, or calling DomNode->node_name on the current node.

Return Values

Returns the name of the current DomElement node.

Examples

Example #1 Getting the node name

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


?>

Migrating to PHP 5

Use the tagName property of the DOMElement object.



add a noteadd a note User Contributed Notes
Returns the name of the current element
There are no user contributed notes for this page.




<DomElement->set_attribute()DomNode->add_namespace>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs