How to limit the length of characters in php and how to get rid of it
Calculate the character length of a string with multibyte mb_strlen ().
Intercept characters of a specified length with mb_substr ().
It is impossible to intercept non-Latin words (such as Arabic and Chinese) correctly by using strlen, which is nominally for Latin, but actually for byte bytes in the code.