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

search for in the

DomDocument->add_root> <DomAttribute->specified
Last updated: Fri, 13 Nov 2009

view this page in

DomAttribute->value

(PHP 4 >= 4.1.0)

DomAttribute->value Retorna o valor do atributo

Descrição

DomAttribute
string value ( void )

Esta função retorna o valor do atributo.

Exemplos

Exemplo #1 Obtendo todos os atributods de um node

<?php

include("example.inc");

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

$root $dom->document_element();
$attrs $root->attributes();

echo 
'Attributes of ' $root->node_name() . "\n";
foreach (
$attrs as $attribute) {
     echo 
' - ' $attribute->name ' : ' $attribute->value "\n";
}

?>

O exemplo acima irá imprimir:

Attributes of chapter
 - language : en

Valor Retornado

Retorna o valor do atributo.

Migrando para o PHP 5

Use a propriedade value da DOMAttr.



add a note add a note User Contributed Notes
DomAttribute->value
There are no user contributed notes for this page.

DomDocument->add_root> <DomAttribute->specified
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites