How to iterate UTF-8 string in PHP?

Use preg_split. With “u” modifier it supports UTF-8 unicode.

$chrArray = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);

Leave a Comment