I have an HTML textarea box that I want to save the input from into a text file.
Instead of printing each 'Enter /return' on a new line I want it on the same line with <br> printed instead.
I am using this at the moment but it doesn't quite work how I'd like;
$input =~ s/\n/<br>/g;
Example:
Input:
This
is
input.
Currently saves as:
This
<br>is
<br>
<br>input.
But I want it like this:
This<br>is<br><br>input.
If you get what I mean, is this possible?
Many Thanks, S-P.
Start Free Trial