Location: PHPKode > scripts > display HTML on webpage > display HTML on webpage/print-html-tags.php
<?php 
/*  Copyright (C)  2012  sreeblog.net. */

if(isset($_POST['submit'])) {
   $txt = $_POST["intext"];
   $arr = array("<",">");
   $replace = array("&amp;lt","&amp;gt");
   $txt1 = str_replace($arr,$replace,"$txt");
   $arr = split( "\n", $txt1);
    for($i=0;$i<count($arr);$i++) {
        echo  "$arr[$i]" . "<br/>"; 
    }
}
?>
<form method="post" action="">
<textarea cols=50 rows=10 name="intext" value="">  </textarea><br/>
<input type="submit" style="width:auto" name="submit" /> <br/>
</form>
Return current item: display HTML on webpage