How replace (use regex in PHP5) invalid characters in utf-8 string on white space characters?
use iconv
$text = iconv("UTF-8", "UTF-8//IGNORE", $text);
see the manual.
Cheers