在textarea中添加新行

I have this string that i am displaying in a textarea from the database: $content = "Lamuvidine 89%(Rsd = 6% ; n = 9)"; I would like to "Lamuvidine 89%" to be on the first line and the remaining parts of the string on the second line. I have tried to store the string in the db as "Lamuvidine 89% (Rsd = 6% ; n = 9)" - without quotes, note the new line i have added but nothing.

NOTE: $content = "Lamuvidine 89%(Rsd = 6% ; n = 9)"; //the whole string is in a single row of a db column called content

The results should be

Lamuvidine 89% //should be bold
(Rsd = 6% ; n = 9)

I did this and stored in the db

<strong>Lamuvidine 89%</strong>

(Rsd = 6% ; n = 9)

I still yield no results, suggestions!

You should replace with <br /> if you are trying to do a line break

$content = "<b>Lamuvidine 89%<b><br />(Rsd = 6% ; n = 9)";

insert into your database like this "Lamuvidine 89%<br>(Rsd = 6% ; n = 9)"

instead of Lamuvidine 89% (Rsd = 6% ; n = 9)

it will break the line

As u know any formatted text in textarea will be rendered as plain text by browser, if u want to apply effects then u should use editable divs for that:

for a proper editable div that looks similar to textarea u just have to set

<div style="background-color:#fff;" contentEditable=true></div>

here is a working example which can help u editable Div