I haven't found a solution yet in StackOverlfow to my problem.
I'm using nl2br()
in PHP to insert linebreaks <br>
instead of
when storing a message on the database. The thing is I want to have a preview of that message that has no linebreaks. HOw do I remove the linebreaks <br>
?
I have tried text.replace('<br>', '');
"Hi guys!"
<br>
<br>
"How are you?"
Should be
"Hi guys! guys how are you?"