I know that there are many types of space (em space, en space, thin space, non-breaking space, etc), but, all these, that I refered, have HTML entities (at least, PHP\'s htm
They are all plain spaces (returning character code 32) that can be caught with regular expressions or trim().
Try this:
preg_replace("/\s{2,}/", " ", $text);