|
-
Jun 29th, 2002, 06:27 AM
#1
Thread Starter
Fanatic Member
retrieving MySQL string's
when a string is saved on the server, how can i retrieve it with the line-breaks still there ? (insert '<br>' where appropriate)
-
Jun 29th, 2002, 10:55 AM
#2
New Member
-
Jun 29th, 2002, 11:11 AM
#3
Thread Starter
Fanatic Member
if i had to save a string from an html input field, it should just save it as a straight line od\f text. but i want it to be multiple lines like it was when entered in the field.
-
Jun 29th, 2002, 11:18 AM
#4
New Member
use the nl2br() function. I believe that should do the trick. Read up on it at http://www.php.net/nl2br/. Never used it though so i cant advise.
-
Jun 30th, 2002, 06:30 AM
#5
Thread Starter
Fanatic Member
thanx pro
-
Jun 30th, 2002, 08:47 AM
#6
or you can use this
$textboxreplace("(\r\n|\n|\r)", "<br>", $textbox);
-
Jul 1st, 2002, 05:25 PM
#7
Thread Starter
Fanatic Member
i was initially thinking along those lines scoutt 
but didnt you mean:
$textbox = replace("(\r\n|\n|\r)", "<br>", $textbox);
-
Jul 1st, 2002, 05:58 PM
#8
well close. I did mess up though so it should be like this
$textbox = ereg_replace("(\r\n|\n|\r)", "<br>", $textbox);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|