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

search for in the

DomElement::tagname> <DomElement::set_attribute_node
[edit] Last updated: Fri, 25 May 2012

view this page in

DomElement::set_attribute

(PHP 4 >= 4.1.0)

DomElement::set_attribute Establece el valor d eun atributo

Descripción

DomAttribute DomElement::set_attribute ( string $name , string $value )

Establece un atributo con el nombre name dado en value.

Parámetros

name

El nombre de el atributo. Si este atributo no existe, este se creará.

value

El valor de el atributo.

Valores devueltos

Devuelve el nodo antiguo DomAttribute, o el nuevo si se va a crear un atributo por primera vez.

Ejemplos

Ejemplo #1 Setting an attribute

<?php
$doc 
domxml_new_doc("1.0");
$node $doc->create_element("para");
$newnode $doc->append_child($node);
$newnode->set_attribute("align""left");
?>

Migrando a PHP 5

Use DOMElement::setAttribute.



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

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