<?php
/* Remove all attribute from a node */
foreach ($node->attributes() as $attr)
$node->remove_attribute($attr);
/* Then rename that tag */
$node->set_name('div');
/* And set appropriate "class" attribute */
$node->set_attribute('class','paragraphBox');
?>
DomElement::remove_attribute
(PHP 4 >= 4.1.0)
DomElement::remove_attribute — Supprime un attribut
Description
bool DomElement::remove_attribute
( string
$name
)Supprime un attribut du noeud courant DomElement.
Liste de paramètres
-
name -
Le nom de l'attribut à supprimer.
Valeurs de retour
Cette fonction retourne TRUE en cas de
succès ou FALSE si une erreur survient.
Migration vers PHP 5
Utilisez DOMElement::removeAttribute.
fpiat / bigfoot com
18-Apr-2006 02:38
