Page 1 of 1
Break lines / paragraphs
Posted: Sun Aug 15, 2004 9:18 am
by dwfait
Hi. In my script people can PM each other, and administrators can post news. But, whenever i put a new line in, when you read it after you have posted it, there isnt a new line, it just continues. How can i put a new line where i put a new line and stuff?
Posted: Sun Aug 15, 2004 9:22 am
by tim
Posted: Sun Aug 15, 2004 9:35 am
by dwfait
Thanks, it worked.
Posted: Sun Aug 15, 2004 9:58 am
by Getran
i think i did it a different way once, using ereg_replace(). something like this:
$text = ereg_replace("\n","<br>",$text);
anyway, as he said it worked so i dunno why i'm posting this

Posted: Sun Aug 15, 2004 1:36 pm
by tim
Getran, you could use regular expressions to achieve this, but when theres a function designed for it, why not use it?
Envoking the regEx engine when you dont need too is a bad practice.