PHP string intercept function substr and Chinese intercept: mb_substr
[code]string substr (string $string, int $start.#91; int $length) / > if it is non negative, the positive number is the first few, starting from 0.
if start is negative, the countdown number starts from -1.
if the length of string is less than or equal to start, it will return FALSE.
(Note: a function that PHP takes to intercept a string, can only handle English, numerals, can't intercept Chinese mixed rows)
[code]// constructs string
$str =.Quot; ABCDEFGHILMNOPQ.quot;
/ / / / > from fifth strings to last
$str1 = (5); / / / output ILMNOPQ
/ / / / / / / / / / / / / / / / / / / / / / / / = substr ($str, 9,4) from ninth characters; / / / / / output LMNO
5 characters
$str3 = substr. / / / / / output HIL
Chinese intercepting: mb_substr ()
$start, cut off the beginning, the beginning of the 0
$length, the number of words to be intercepted
$encoding, web code, such as UTF-8, GB2312, GBK
[code]
.lt; T; [/code]