<HTML ><HEAD ><TITLE >DomDocument->dump_mem</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="DOM XML functions" HREF="ref.domxml.html"><LINK REL="PREVIOUS" TITLE="DomDocument->dump_file" HREF="function.domdocument-dump-file.html"><LINK REL="NEXT" TITLE="DomDocument->get_element_by_id" HREF="function.domdocument-get-element-by-id.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" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.domdocument-dump-file.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.domdocument-get-element-by-id.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.DomDocument-dump-mem" ></A >DomDocument->dump_mem</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN21235" ></A ><P > (no version information, might be only in CVS)</P >DomDocument->dump_mem -- Dumps the internal XML tree back into a string </DIV ><DIV CLASS="refsect1" ><A NAME="AEN21238" ></A ><H2 >Description</H2 >string <B CLASS="methodname" >DomDocument->dump_mem</B > ( [bool format [, string encoding]])<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV ><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. </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN21255" ></A ><P ><B >Example 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); echo "<PRE>"; echo htmlentities($doc->dump_mem(true)); echo "</PRE>"; ?></PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > The first parameter was added in PHP 4.3.0. </P ></BLOCKQUOTE ></DIV ><P > See also <B CLASS="function" >domdocument_dump_file()</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-dump-file.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.domdocument-get-element-by-id.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >DomDocument->dump_file</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.domxml.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >DomDocument->get_element_by_id</TD ></TR ></TABLE ></DIV ></BODY ></HTML >