I am trying to do a line break after the message “Original message”, I have tried with this but It keeps showing me the
---Original message---<br />
message
<textarea id="txtMessage" rows="10" cols="50"><?php echo nl2br(str_replace('<br/>', " ","---Original message---\n".$array['message']));?></textarea>
I want something likes this:
---Original message---
message
any advise?
This should do what you want it to:
Example:
Result:
But if you try this:
you will get this:
Therefore you should not use nl2br before saving it to database, otherwise you have to get rid of
<br />every time you try to edit text! Just use it when you print it out as text.