SimpleXMLElement::addChild Ajoute un élément enfant au nœud XML &reftitle.description; public SimpleXMLElementnullSimpleXMLElement::addChild stringqualifiedName stringnullvalue&null; stringnullnamespace&null; Ajoute un élément enfant au nœud et retourne un SimpleXMLElement de l'enfant. &reftitle.parameters; qualifiedName Le nom de l'élément enfant à ajouter. value Si spécifié, la valeur de l'élément enfant. namespace Si spécifié, l'espace de nom auquel l'élément enfant appartient. &reftitle.returnvalues; La méthode addChild retourne un objet SimpleXMLElement représentant l'enfant à ajouter au nœud XML en cas de succès; &null; en cas d'échec. &reftitle.examples; Les exemples listés incluent parfois example.php, ceci fait référence à la chaine XML du premier exemple de l'utilisation de base. Ajoute des attributs et des enfants à un élément SimpleXML addAttribute('type', 'documentary'); $movie = $sxe->addChild('movie'); $movie->addChild('title', 'PHP2: More Parser Stories'); $movie->addChild('plot', 'This is all about the people who make it work.'); $characters = $movie->addChild('characters'); $character = $characters->addChild('character'); $character->addChild('name', 'Mr. Parser'); $character->addChild('actor', 'John Doe'); $rating = $movie->addChild('rating', '5'); $rating->addAttribute('type', 'stars'); echo $sxe->asXML(); ?> ]]> &example.outputs.similar; PHP: Behind the Parser Ms. Coder Onlivia Actora Mr. Coder El ActÓr So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary. PHP solves all my web problems 7 5 PHP2: More Parser Stories This is all about the people who make it work. Mr. Parser John Doe 5 ]]> &reftitle.seealso; SimpleXMLElement::addAttribute