Dans :
Fonctions PHP
Concepts PHP
Fonctions MySQL
Fonctions HTML
Forum PHP/MySQL
Cours PHP/MySQL
Scripts PHP/MySQL
DomDocument->add_root ajoute un noeud racine au document dom, et retourne le nouveau noeud. Le nom de l'élément créé est fourni par le paramètre name .
<?php$doc = domxml_new_doc("1.0");$root = $doc->add_root("html");$head = $root->new_child("head", "");$head->new_child("title", "Voilà le titre");echo htmlentities($doc->dump_mem());?>