mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
27 lines
432 B
Plaintext
27 lines
432 B
Plaintext
|
--TEST--
|
||
|
DOMDocument::saveHTML() vs DOMDocumet::saveXML()
|
||
|
--SKIPIF--
|
||
|
<?php
|
||
|
require_once dirname(__FILE__) .'/skipif.inc';
|
||
|
?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$d = new DOMDocument();
|
||
|
$str = <<<EOD
|
||
|
<html>
|
||
|
<head>
|
||
|
</head>
|
||
|
<body>
|
||
|
<p>Hi.<br/>there</p>
|
||
|
</body>
|
||
|
</html>
|
||
|
EOD;
|
||
|
$d->loadHTML($str);
|
||
|
$e = $d->getElementsByTagName("p");
|
||
|
$e = $e->item(0);
|
||
|
echo $d->saveXml($e),"\n";
|
||
|
echo $d->saveHtml($e),"\n";
|
||
|
--EXPECTF--
|
||
|
<p>Hi.<br/>there</p>
|
||
|
<p>Hi.<br>there</p>
|