Welcome Guest, Not a member yet? Register   Sign In
how to keep whitespace when inserting
#1

[eluser]runrun[/eluser]
In submit form, I input some thing like this:

"Over 30 years old<br /><br />

Have knowledge in administration, investment process in construction.<br /><br />

Have a good organization skill"



But when I call database, It only outputs a clean string, all breaks gone

"
Over 30 years old ave knowledge in administration, investment process in construction.Have a good organization skill
"

How can I keep those breaks ?
#2

[eluser]Colin Williams[/eluser]
nl2br() http://php.net/nl2br

HTML treats new lines as white space (unless inside a < pre > element) so you must use something like nl2br to turn these into breaks. CI also has an auto_typography helper (or is it a class now) that will help you here




Theme © iAndrew 2016 - Forum software by © MyBB