PHP 手冊
上一頁 |  | 下一頁

# DomDocument->document_element

(no version information, might be only in CVS)

DomDocument->document_element -- Returns root element node

## Description

object DomDocument->document_element ( void )

This function returns the root element node of a document.

The following example returns just the element with name CHAPTER and prints it. The other node -- the comment -- is not returned.

示範 1.Retrieving root element
`<?php include("example.inc"); if (!$dom = domxml_open_mem($xmlstr)) { echo "Error while parsing the document\n"; exit; } $root = $dom->document_element(); print_r($root); ?>`

上一頁 | 最開頭 | 下一頁
DomDocument->doctype | 上一層 | DomDocument->dump_file