I have a form which after submission reports the entered values. One of the values is multiline text (mediumtext). I am using eregi_replace to replace the carriage breaks (\r\n in this case) with <br> in the formatted results.
The code is below:
<?php
$workout = mysql_escape_string($_POST['newworkoutdesc']);
// changes carriage returns into line breaks
$workoutdescription = eregi_replace("\r\n","<br> ",$workout);
echo $workoutdescription;
?>
The Output:
4-5 x 1 Mile at 1/2 marathon effort\r\n8 x 200 strides\r\n\r\n40 seconds rest after the miles.\r\n
The odd thing is that I am using pretty much the same code elsewhere and it works. The main difference is that the value for the code that works is being pulled from a database.
I could use some help with this one.
Thanks.