Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

 

DomDocument->dump_file

(no version information, might be only in CVS)

DomDocument->dump_file --  Scarica in un file l'albero XML interno

Descrizione

string DomDocument->dump_file ( string nomefile [, bool compressione [, bool formato]])

La funzione crea un documento XML dalla rappresentazione DOM. Solitamente questa funzione viene richiamata dopo avere creato da zero un nuovo documento XML, come nell'esempio seguente. Il parametro formato specifica se l'output debba essere ben formattato o meno. Il primo parametro specifica il nome del file ed il secondo se debba essere compresso o meno.

Esempio 1. Creazione dell'intestazione di un documento HTML

<?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);
?>

Vedere anche domdocument_dump_mem() e domdocument_html_dump_mem().

 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "Manuale PHP". See Index Page for more info about Authorship and Copyright.

1999-2009 Linuxinfor.com. No rights reserved.