Encodage prég_replace
$html = preg_replace("/\s/u", "", $html);
Fantastic Ferret
$html = preg_replace("/\s/u", "", $html);