php/mysql: losing whitespace
- Started
- Last post
- 9 Responses
- morphinelips
Hey, I built a NT style message board for a site, but when I pull a message from my database, all of the whitespace is lost when it gets outputted to the page. is there a way in php to maintain that white space?
thx..
- CAJTBr0
what do you mean by whitespace?
url?
- morphinelips0
well, what i mean is when i look in my db i see an entry like this:
"hi,
i have whitespace.i am able to skip lines."
when it shows up on my messageboard it looks like this:
"hi, i have whitespace. i am able to skip lines."
the url is http://forum.moonpix.com
- monokrom0
nl2br
- Epictive0
Hey morphinelips, I am at RIT too. (Just incase you cared).
-A
- CAJTBr0
in html, a return character does not equal a carriage return on the page. the easiest thing to do would be to do a substring replace of return characters with s
- unknown0
does that in the pbs, too.
- motivdesign0
It's all about nl2br()
Look it up.
- morphinelips0
thanks for the function monokrom, worked perfect.
Hey Epictive, what are you doing at RIT? Are you a graphic design major? I was IT until I graduated last quarter..
- Epictive0
"Hey Epictive, what are you doing at RIT? Are you a graphic design major?"
Nope, New Media Design here, too bad you arent still here, be cool to talk to another NTer and talk geek web talk.
-A