MyBB Community Forums

Full Version: Multiple lines to one line (php)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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);