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

search for in the

SimpleXMLElement::getNamespaces> <SimpleXMLElement::getDocNamespaces
[edit] Last updated: Thu, 23 May 2013

view this page in

SimpleXMLElement::getName

(PHP 5 >= 5.1.3)

SimpleXMLElement::getNameRetorna el nombre del elemento XML

Descripción

public string SimpleXMLElement::getName ( void )

Retorna el nombre del elemento XML.

Valores devueltos

El método getName retorna como string el nombre de la etiqueta XML referenciada por el objeto SimpleXMLElement.

Ejemplos

Nota:

Los ejemplos listados quizá incluyen example.php, que hacen referencia a la cadena XML encontrada en el primer ejemplo de la guía de uso básico.

Ejemplo #1 Retornar el nombre del elemento XML

<?php
 
include 'example.php';
$sxe = new SimpleXMLElement($xmlstr);

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

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

?>

El resultado del ejemplo sería:

peliculas
pelicula



add a note add a note User Contributed Notes SimpleXMLElement::getName - [0 notes]
There are no user contributed notes for this page.

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