<?php
if(isset($_POST['content'])){
 echo preg_replace('/\r\n/','',htmlspecialchars($_POST['content']));
 }
?>
<form method="post" action="" style="width:500px;margin:0 auto">
<textarea  name="content" cols="50" rows="15"></textarea>
<input type="submit">
</form>