[thelist] PHP: How to detect a line break in a textfield

Kae Verens kverens at contactjuggling.org
Tue Feb 25 08:14:01 CST 2003

Chris Marsh wrote:
> Of course had I actually read the subject line I would have noticed that
> PHP was the technology being used. Sorry:(

of course, I didn't read the subject line, so ignored the message.

$text=preg_replace('/\n|\r|\n\r/','<br />',$text);

or, just use nl2br();

Kae Verens               _______\_   webworks.ie
pay:  www.webworks.ie       _____\\__   webhosts
play: www.contactjuggling.org  ___\\\___  design
  kae: kverens.contactjuggling.org _\\\\____ code

More information about the thelist mailing list