Well, there you go shadowsai. You see these code blocks:
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>';