you want to use the white space css attribute http://www.w3schools.com/cssref/pr_text_white-space.asp
So you will have something like
<p class="whitespace"><?= $input_from_textarea ?></p>
using css:
.whitespace { white-space: pre-wrap; }
Do not manually clear your entry by replacing new line elements with break tags. This makes your data less reusable and works a lot more.
You can use the php function nl2br() , but it does not give you as much control as display control via css.
source share