Originariamente inviato da sir daniel
potresti fare
$string = str_replace(' ', '&.nbsp;', $string);

ovviamente togliendo il. dopo la &
Grazie