Forum Moderators: coopster
My problem is that doing that there are no breakmarks! Someone told me that if I use a textarea there are </br>'s that are automatically added by mysql. Then when I want to display it I use the code
str_replace("\n","<br/>",$str); for the string is the stuff I want to display. But this doesn't work! Please help!
Yeah me time to type away
<br/>
<br/>Yeah me time to type away
How do I get the break marks to go away when I wanna edit it, but have them work?(ie still have lines where they werer supposed to go) Hopefully you understand.
str_replace("\n","<br/>",$str);
What this is doing is taking any "\n" (newline) in $str and converting it to "<br/>"...odds are that this is why you have <br/> showing up...you need to switch the order...
str_replace("<br/>","\n",$str);
I would also assume you need to assign the return of str_replace() to a variable and then access that variable to fill in the textarea. I doubt the method operates inline, though as I mentioned I'm not familiar with PHP, so you should probably check the documentation for str_replace() if you can.
I think you'd basically end up with something like...
$ta = str_replace("<br/>","\n",$str);
...
echo "<textarea ...>";
echo ta;
echo "</textarea>";
Jordan