I had to repost this due to the fact that the software won't allow me to add information to the thread because I am "Double posting".
I need to remove all of the newline chars from a string. I have this:
$welcome = nl2br($welcome);
$welcome = str_replace("\n","",$welcome);
First, I thought that the nl2br would do the job but it doesnt. The str_replace still doesnt do the job I need.
Here is the scenario: The text here is entered in a user admin and displayed in a Flash text area. The nl characters actually display as new lines in the flash, even if they have no effect in a regular HTML doc. I can't figure out how to get them outta there.
If I have:
Line 1
Line 2
Line 3
And I run it through nl2br I end up with this:
Line 1
<br>
Line 2
<br>
Line 3
And running it through str_replace("\n","",$welcome); doesnt change anything.
I need it ti look like this:
Line 1<br>Line 2<br>Line 3
So that it will display properly in Flash.
Any ideas?