The two Chinese characters and Japanese characters are not in the same position, but the length obtained by using the mb_strlen function is indeed the same. The test code is as follows: {code ...} the length of the test result is 59, but the length is obviously inconsistent with the naked eye. This will cause the mb_substr... the two Chinese characters and Japanese characters are not in the same position, but the length obtained by using the mb_strlen function is indeed the same. The test code is as follows:
$ Str_0 = '[silver subtitle group] [Doraemon] [006] [GB] [2005.05.20] Secret espionage & Hello! Yu '; $ str_1 = 'Hello Kitty no Happy Birthday (please wait until there are too many attempts) OVA. mp '; $ str_2 = 'Arr] Hello Kitty no Fushigi no Kuni no Alice. myHD. lucky luck. hello babies.w.w.gov.ac-3.1920x1080-myfun4u.mkv '; return mb_strlen ($ str_0, 'utf-8 '). '@'. mb_strlen ($ str_1, 'utf-8 '). '@'. mb_strlen ($ str_2, 'utf-8 '). '@'. mb_strlen ($ str_3, 'utf-8 ');
The length of the test results is 59, but it is obvious to the naked eye that the length is not uniform. In this case, the length of the Data intercepted by the mb_substr function is not uniform, and the line break is displayed on the front end.
How do you solve this problem?
Reply content:
The two Chinese characters and Japanese characters are not in the same position, but the length obtained by using the mb_strlen function is indeed the same. The test code is as follows:
$ Str_0 = '[silver subtitle group] [Doraemon] [006] [GB] [2005.05.20] Secret espionage & Hello! Yu '; $ str_1 = 'Hello Kitty no Happy Birthday (please wait until there are too many attempts) OVA. mp '; $ str_2 = 'Arr] Hello Kitty no Fushigi no Kuni no Alice. myHD. lucky luck. hello babies.w.w.gov.ac-3.1920x1080-myfun4u.mkv '; return mb_strlen ($ str_0, 'utf-8 '). '@'. mb_strlen ($ str_1, 'utf-8 '). '@'. mb_strlen ($ str_2, 'utf-8 '). '@'. mb_strlen ($ str_3, 'utf-8 ');
The length of the test results is 59, but it is obvious to the naked eye that the length is not uniform. In this case, the length of the Data intercepted by the mb_substr function is not uniform, and the line break is displayed on the front end.
How do you solve this problem?
... I output 59 in the program here, and then each of them is specially counted twice. It is 59 characters ..mb_strlen
No problem...