$string = "onvodf oicj ijji ndssssss ggjbnjg";
//$string = html_entity_decode($string);
$string = preg_replace('/( |\s)+/i', 'z', $string);
раз
два