DomDocument->document_element
(No version information available, might be only in CVS)
DomDocument->document_element — Restituisce il nodo radice
Descrizione
domelement DomDocument->document_element
( void
)
Questa funzione restituisce il nodo radice di un documento.
Nell'esempio seguente la funzione restituisce l'elemento con nome CHAPTER. L'altro nodo -- the comment -- non viene restituito.
Example#1 Recupero dell'elemento radice
<?php
include("example.inc");
if (!$dom = domxml_open_mem($xmlstr)) {
echo "Errore nel parsing del documento\n";
exit;
}
$root = $dom->document_element();
print_r($root);
?>
Il precedente esempio visualizzerà :
domelement Object ( [type] => 1 [tagname] => chapter [0] => 6 [1] => 137960648 )