Comunitatea PHP Romania
 

 
DOMDocument->save

DOMDocument->save

(no version information, might be only in CVS)

DOMDocument->save --  Dumps the internal XML tree back into a file

Description

int DOMDocument->save ( string filename)

Creates an XML document from the dom representation. The number of bytes written is returned. This function is usually called after building a new dom document from scratch as in the example below.

Exemplu 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->save("/tmp/test.xml");
?>

See also DOMDocument->load(), DOMDocument->loadXML() and DOMDocument->saveXML().

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Free Credit Report | Music Festival | Xbox Mod Chip | Mortgage Calculator | Credit Cards
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis