You could use htmlspecialchars and htmlspecialchars_decode combined with htmlEntities ,html_entity_decode
htmlspecialchars — Convert special characters to HTML entities
See documentation here http://php.net/htmlspecialchars
htmlspecialchars_decode — Convert special HTML entities back to characters
See documentation here http://php.net/manual/en/function.htmlspecialchars-decode.php
$htmlcode = htmlentities(htmlspecialchars(thehmldata));
echo $htmlcode;
echo html_entity_decode(htmlspecialchars_decode($htmlcode));
沒有留言:
發佈留言