1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
--TEST--
DOMDocument::save Test basic function of save method
--EXTENSIONS--
dom
--FILE--
<?php
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$root = $doc->createElement('book');
$root = $doc->appendChild($root);
$title = $doc->createElement('title');
$title = $root->appendChild($title);
$text = $doc->createTextNode('This is the title');
$text = $title->appendChild($text);
$temp_filename = __DIR__."/DomDocument_save_basic.tmp";
echo 'Wrote: ' . $doc->save($temp_filename) . ' bytes'; // Wrote: 72 bytes
?>
--CLEAN--
<?php
$temp_filename = __DIR__."/DomDocument_save_basic.tmp";
unlink($temp_filename);
?>
--EXPECT--
Wrote: 72 bytes
|