Search DaTutorials:  
HOME
Php Tutorials
Articles
Basics
Date and Time
File Manipulations
Forms
Functions
General
Interactivity
MySql
Navigation
News,Shoutboxes and Blogs
Language Structure and Data Types
Searching
Security
String Manipulation
User Information and Stats
Search For a Tutorial
Php Reference

DOMDocument->saveHTMLFile

(no version information, might be only in CVS)

DOMDocument->saveHTMLFile --  Dumps the internal document back into a file using HTML formatting

Description

string DOMDocument->saveHTMLFile ( string filename)

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.

Example 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);
$doc->saveHTMLFile("/tmp/test.hmtl");
?>

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



Copyright © 2001-2004 The PHP Group
All rights reserved.

     Credit Counseling | Share Prices | Loans | Project cars | Loans
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp