웹프로그래밍에서.. html을 그대로 출력하는 방법이 있나요?

ft775의 이미지

html을 그대로 나타낼수 있는 함수나 방법을 알려주세요

송지석의 이미지

pre 태그면 될까요?

<pre>
<html>
</html>
<table>
</table>
.....
</pre>
hdsong의 이미지

아래 내용 과 관련있는거 같은데요..

http://kltp.kldp.org/stories.php?story=01/08/22/1094224

지리즈의 이미지

<?php 
# showHtmlCode.php
#php < 4.3
function file_get_contents($f) {
   ob_start();
   $retval = @readfile($f);
   if (false !== $retval) { // no readfile error
      $retval = ob_get_contents();
   }
   ob_end_clean();
  return $retval;
}

$file=file_get_contents($FileName); 
$new = htmlspecialchars($file, ENT_QUOTES); 
echo "<pre>\n";
echo $new; // &a href='test'&Test&/a& 
echo "</pre>\n";
?>

There is no spoon. Neo from the Matrix 1999.