Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- DOMDocument::saveHTML() vs DOMDocumet::saveXML() --EXTENSIONS-- dom --FILE-- <?ph..
Decoded Output download
--TEST--
DOMDocument::saveHTML() vs DOMDocumet::saveXML()
--EXTENSIONS--
dom
--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),"
";
echo $d->saveHtml($e),"
";
?>
--EXPECT--
<p>Hi.<br/>there</p>
<p>Hi.<br>there</p>
Did this file decode correctly?
Original Code
--TEST--
DOMDocument::saveHTML() vs DOMDocumet::saveXML()
--EXTENSIONS--
dom
--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";
?>
--EXPECT--
<p>Hi.<br/>there</p>
<p>Hi.<br>there</p>
Function Calls
None |
Stats
MD5 | 83761070ef1bf7a011555938a83a1629 |
Eval Count | 0 |
Decode Time | 102 ms |