For the sake of using the SMS platform, each text message has a limit on the number of words, and the server of the SMS platform does not analyze it on its own. The background of the SMS platform is separated by itself, but the api does not have this function. I searched for some time on the internet and found that nothing happened. Then I figured out a way to calculate
For the sake of using the SMS platform, each text message has a limit on the number of words, and the server of the SMS platform does not analyze it on its own.
The background of the SMS platform is separated by itself, but the api does not have this function.
I searched for some time on the internet and found that nothing happened.
Later, I thought of a solution, which is original.
Only use the intercept and replacement functions.
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 ); } |