DOMDocument_saveHTML_variant1.phpt 599 B

12345678910111213141516171819202122
  1. --TEST--
  2. DOMDocument::saveHTML() optional parameters
  3. --EXTENSIONS--
  4. dom
  5. --FILE--
  6. <?php
  7. $doc = new DOMDocument('1.0');
  8. $root = $doc->createElement('html');
  9. $root = $doc->appendChild($root);
  10. $head = $doc->createElement('head');
  11. $head = $root->appendChild($head);
  12. $title = $doc->createElement('title');
  13. $title = $head->appendChild($title);
  14. $text = $doc->createTextNode('This is the title');
  15. $text = $title->appendChild($text);
  16. echo $doc->saveHTML(NULL), "\n";
  17. echo $doc->saveHTML($title), "\n";
  18. ?>
  19. --EXPECT--
  20. <html><head><title>This is the title</title></head></html>
  21. <title>This is the title</title>