Because php is developed in foreign countries, garbled characters are often captured when it is used in both Chinese and English. Today we want to talk about it to solve this problem. If you need it, please refer to it. Because php is developed in foreign countries, garbled characters are often captured when it is used in both Chinese and English. Today we want to talk about it to solve this problem. If you need it, please refer to it.
Script ec (2); script
| The Code is as follows: |
|
|
Function smssubstr ($ string, $ length ){
If (strlen ($ string) <= $ length ){
Return $ string;
}
$ Strcut = '';
For ($ I = 0; $ I <$ length; $ I ++ ){
$ Strcut. = ord ($ string [$ I]) & gt; 127? $ String [$ I]. $ string [++ $ I]: $ string [$ I];
}
Return $ strcut;
}
For ($ I = 1; $ I <= $ smsnum; $ I ++ ){
$ {'Smscontent'. $ I} = smssubstr ($ message, $ smsper );
$ Message = str_replace ($ {'smscontent'. $ I}, "", $ message );
} |