<?php $text = 'سسس ککک سسس'; echo preg_replace(['/(.)\1+/u', '/\b(\pL)\s+/u'], '$1', $text);
You have javascript disabled. You will not be able to edit any code.