@@ 62-69 (lines=8) @@ | ||
59 | */ |
|
60 | public function CountPart ($s_sms = '') { |
|
61 | // Is there chinese in sms ? |
|
62 | if (mb_strlen($s_sms, 'utf-8') == strlen($s_sms)) { |
|
63 | // No chinese, 140 chars per part |
|
64 | return (ceil(strlen($s_sms) / 140)); |
|
65 | } |
|
66 | else { |
|
67 | // Convert chinese char to ascii, for count |
|
68 | return (ceil(mb_strlen($s_sms, 'utf-8') / 70)); |
|
69 | } |
|
70 | } // end of func CountPart |
|
71 | ||
72 |
@@ 88-92 (lines=5) @@ | ||
85 | ||
86 | ||
87 | // Is there chinese in sms ? |
|
88 | if (mb_strlen($sms, 'utf-8') == strlen($sms)) { |
|
89 | return intval(ceil(strlen($sms) / 140)); |
|
90 | } else { |
|
91 | return intval(ceil(mb_strlen($sms, 'utf-8') / 70)); |
|
92 | } |
|
93 | } |
|
94 | ||
95 |