I haven’t found a solution yet in StackOverlfow to my problem.
I’m using nl2br() in PHP to insert linebreaks <br> instead of \n 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?"
Could you post the exact code that you’ve tried and doesn’t work?? This works fine:
text.replace('<br>', '');isn’t a global replacement.