View Single Post
Old 12-12-2012, 03:52 AM   PM User | #11
shadowsai
New Coder

 
Join Date: Dec 2009
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
shadowsai is an unknown quantity at this point
Quote:
Originally Posted by Custard7A View Post
Well, there you go shadowsai. You see these code blocks:

Code:

This     had 5 spaces
They aren't replacing any conjoining spaces with nbsp, just outputting the text into a pre element.

All you need is:

PHP Code:


$original 
'This     had 5 spaces'
echo 
'<pre>' $original '</pre>'

Thanks! I can't believe that one slipped my mind.

Yeah, I knew that it was the HTML that was causing the spaces to be collapsed, but couldn't think of something other than replacing everything with &nbsp;.
shadowsai is offline   Reply With Quote