I know how to get the text from text boxes but it is not grabbing line breaks so like if somebody type the following in a text box:
a
b
c
d
Right now it comes out as abcd. How can I get the spacing to stay? Also this has to be stored in a mysql database if that makes any difference.
get text exactly as is form text box
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: get text exactly as is form text box
Use nl2br() that converts the newlines to HTML <br> tags. Depending upon how you want to do this, you can do it before inserting it into the DB or do it when you want to display.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: get text exactly as is form text box
worked perfectly thanks.