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

<SimpleXMLElement->getDocNamespaces()SimpleXMLElement->getNamespaces()>
Last updated: Thu, 26 Jun 2008

SimpleXMLElement->getName()

(PHP 5 >= 5.1.3)

SimpleXMLElement->getName() — Gets the name of the XML element

Description

SimpleXMLElement
string getName ( void )

Gets the name of the XML element.

Return Values

The getName method returns as a string the name of the XML tag referenced by the SimpleXMLElement object.

Examples

Example #1 Get XML element names

<?php
 
$sxe
= new SimpleXMLElement($xmlstr);

echo
$sxe->getName() . "\n";

foreach (
$sxe->children() as $child)
{
   echo
$child->getName() . "\n";
}

?>



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




<SimpleXMLElement->getDocNamespaces()SimpleXMLElement->getNamespaces()>
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