- mb_strlen: documentation ( source)
- preg_split: documentation ( source)
<?php
$string = '$£%wow!😮';
echo 'No mb: ' . strlen($string) . PHP_EOL;
echo 'With mb: ' . mb_strlen($string) . PHP_EOL;
$chrArray = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY);
foreach ($chrArray as $chr) {
echo $chr . ' ' . strlen($chr) . PHP_EOL;
}