Multiple lines to one line (php)
#1
I'm still working on the gallery mod, but outside the mybb system now. I'll see how far I can integrate it in mybb when it's done. But I have a little problem now. I'm working on adding descriptions but if someone adds a description in 2 or more lines, the script doesn't work. So I want to know how to merge them into 1 line.
Like this:
Quote:This is the first line
This is the second one
Third
.....
Must become this:
Quote:This is the first line<br>This is the second one<br>Third<br>.....

EDIT: I found it myself by using this:
	$str = str_replace(chr(13), "<br>", $str);
	$str = str_replace("\n", "", $str);
Reply


Messages In This Thread
Multiple lines to one line (php) - by Smethead - 2005-08-14, 12:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)