<HTML ><HEAD ><TITLE >DomDocument->dump_file</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual de PHP" HREF="index.html"><LINK REL="UP" TITLE="Funciones de DOM XML" HREF="ref.domxml.html"><LINK REL="PREVIOUS" TITLE="DomDocument->document_element" HREF="function.domdocument-document-element.html"><LINK REL="NEXT" TITLE="DomDocument->dump_mem" HREF="function.domdocument-dump-mem.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual de PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.domdocument-document-element.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.domdocument-dump-mem.html" ACCESSKEY="N" >Siguiente</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.DomDocument-dump-file" ></A >DomDocument->dump_file</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN15572" ></A ><P > (no version information, might be only in CVS)</P >DomDocument->dump_file -- Dumps the internal XML tree back into a file </DIV ><DIV CLASS="refsect1" ><A NAME="AEN15575" ></A ><H2 >Description</H2 >string <B CLASS="methodname" >DomDocument->dump_file</B > ( string filename [, bool compressionmode [, bool format]])<BR ></BR ><P > Creates an XML document from the dom representation. This function usually is called after building a new dom document from scratch as in the example below. The <TT CLASS="parameter" ><I >format</I ></TT > specifies whether the output should be neatly formatted, or not. The first parameter specifies the name of the filename and the second parameter, whether it should be compressed or not. </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN15592" ></A ><P ><B >Ejemplo 1. Creating a simple HTML document header</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?php $doc = domxml_new_doc("1.0"); $root = $doc->create_element("HTML"); $root = $doc->append_child($root); $head = $doc->create_element("HEAD"); $head = $root->append_child($head); $title = $doc->create_element("TITLE"); $title = $head->append_child($title); $text = $doc->create_text_node("This is the title"); $text = $title->append_child($text); $doc->dump_file("/tmp/test.xml", false, true); ?></PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > See also <B CLASS="function" >domdocument_dump_mem()</B > <B CLASS="function" >domdocument_html_dump_mem()</B >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.domdocument-document-element.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Inicio</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.domdocument-dump-mem.html" ACCESSKEY="N" >Siguiente</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >DomDocument->document_element</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.domxml.html" ACCESSKEY="U" >Subir</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >DomDocument->dump_mem</TD ></TR ></TABLE ></DIV ></BODY ></HTML >