Two paragraphs Chinese and Japan, from the naked eye is not the same position end, but using the Mb_strlen function to obtain the same length, the test code is as follows:
$str_0 = '[银光字幕组][哆啦A梦新番Doraemon][006][GB][2005.05.20]秘密间谍大作战&Hello!宇';$str_1 = 'Hello Kitty no Happy Birthday (ハローキティとミミィのハッピーバースデー) OVA.mp';$str_2 = 'ARR] Hello Kitty no Fushigi no Kuni no Alice (ハローキティの不思議の国の';$str_3 = '2014.myHD.六福喜事.Hello Babies.粵語中字.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 test result length is 59, but the naked eye obviously see the length is not unified, so that will cause mb_substr this function intercept the data length is not uniform, in the front end will be changed line.
How did everyone solve the problem?
Reply content:
Two paragraphs Chinese and Japan, from the naked eye is not the same position end, but using the Mb_strlen function to obtain the same length, the test code is as follows:
$str_0 = '[银光字幕组][哆啦A梦新番Doraemon][006][GB][2005.05.20]秘密间谍大作战&Hello!宇';$str_1 = 'Hello Kitty no Happy Birthday (ハローキティとミミィのハッピーバースデー) OVA.mp';$str_2 = 'ARR] Hello Kitty no Fushigi no Kuni no Alice (ハローキティの不思議の国の';$str_3 = '2014.myHD.六福喜事.Hello Babies.粵語中字.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 test result length is 59, but the naked eye obviously see the length is not unified, so that will cause mb_substr this function intercept the data length is not uniform, in the front end will be changed line.
How did everyone solve the problem?
... I am here the program output is 59 ... And I've counted two times each. It's all 59 words mb_strlen
. And no problem ...