<?php $string = 'слово слово слово слово'; echo preg_replace("/\w+\K/u", '*', $string);
You have javascript disabled. You will not be able to edit any code.