I\'ve this code to split a string every 3 characters, works fine, but accents are messed:
$splitted_array = str_split(\'waderòrò\',3);
but
I was having the same issue today and here is the solution that I am using. It is basicly using regular expressions.
$re = '/\w{3}/u'; $str = 'waderòròцчшщ中华人民共和国'; preg_match_all($re, $str, $matches); // Print the entire match result print_r($matches);