- English -
Resident Freddy
- Joined
- Apr 7, 2004
- Messages
- 5,263
This is part of my form for a textarea field. I am reading from the database (['content'] being the database row). I want it so when i format in the textarea field, it keeps the same format when it submits to the HTML page.
For example;
Hello
1
2
3
should print out the same in HTML.
However its printing out as Hello 1 2 3.
Ive been trying to look up how, and there seem to be a number of ways, although none I have found help me to implement them. They just give the functions.
string nl2br()
and str_replace
Can anyone help me, ive tried every combination of trying to get it to work!
:S
Code:
<p>Content: <br/></p>
<textarea name="content" rows="10" cols="32"><?php echo $sel_subject['content'];?></textarea></p>
For example;
Hello
1
2
3
should print out the same in HTML.
However its printing out as Hello 1 2 3.
Ive been trying to look up how, and there seem to be a number of ways, although none I have found help me to implement them. They just give the functions.
string nl2br()
and str_replace
Can anyone help me, ive tried every combination of trying to get it to work!
Code:
<p>Content: <br/></p>
<textarea br2nl($sel_subject['content']) name="content" rows="10" cols="32"><?php echo $sel_subject['content'];?></textarea></p>
:S