- preg_replace: documentation ( source)
- setlocale: documentation ( source)
- header: documentation ( source)
<?php
header ( 'Content-Type: text/html; charset=utf-8' );
setlocale ( LC_ALL, 'ru_RU.utf8' );
echo '"' . preg_replace ( '/[^\p{L}\d]/iu', ' ', 'ёйцукенгшщзхъфывапролджэячсмитьбю1234567890' ) . '"';