Im looking to replace carriage returns in a web form with a <br>.
i tried this but no luck
$story = ereg_replace("\r?\n", "<br>", $story);
any help?
TIA, TGixer
NM
i got it to work
Thanks, TGixer:rolleyes:
Just use this function
nl2br($yourstring);
And this the correct form of your function
$story = ereg_replace("\r\n", "<br>", $story);
or
$story = ereg_replace("\n", "<br>", $story);
for more go to:
http://www.php.net/nl2br
🙂