PHP マニュアル
前のページ |  | 次のページ

# DOMDocument->saveHTML

(no version information, might be only in CVS)

DOMDocument->saveHTML -- Dumps the internal document into a string using HTML formatting

## Description

string DOMDocument->saveHTML ( void )

Creates an HTML document from the dom representation. This function usually is called after building a new dom document from scratch as in the example below.

例 1. Creating a simple HTML document header

`<?php $doc = new DOMDocument("1.0"); $root = $doc->createElement("HTML"); $root = $doc->appendChild($root); $head = $doc->createElement("HEAD"); $head = $root->appendChild($head); $title = $doc->createElement("TITLE"); $title = $head->appendChild($title); $text = $doc->createTextNode("This is the title"); $text = $title->appendChild($text); echo "<PRE>"; echo $doc->saveHTML(); echo "</PRE>"; ?>`

See also DOMDocument->loadHTML(), DOMDocument->loadHTMLFile() and DOMDocument->saveHTMLFile().

前のページ | ホーム | 次のページ
DOMDocument->save | 上に戻る | DOMDocument->saveHTMLFile