The php Function Mb_Str_Split
The php function mb_str_split converts the content of a string into an array. It accepts the string and an optional number of characters that will be separated into each array element if split_length is set. The function also returns a FALSE value if it encounters an empty string.
PHP wasn't designed for multibyte character encodings and it is written in C which doesn't support them natively. This means that many tools and libraries need to use complicated approaches to detect multibyte references in their code.
Prior to PHP 8.2, str_split incorrectly returned an empty array when splitting a string that did not contain any bytes at all. This erroneous behavior was fixed in the Mbstring extension as of PHP 8.2 with the introduction of mb_str_split, which functions similarly to str_split but correctly returns an empty array for empty strings.
If you need to split a multibyte string into an array with a given length of chunks, it is recommended that you use mb_str_split. This function will split the string into arrays of a specified length, and each array will contain the corresponding code point of each character in the string. This is a much more efficient way to work with multibyte strings than the older approach using str_split, which splits the string into chunks but does not account for the fact that some characters take multiple bytes to represent. This is a major improvement and I encourage you to make the switch to mb_str_split in all of your PHP applications.