The string truncation function starts. String truncation function starts functioncsubStr ($ str, $ start, $ len) {$ strlenstrlen ($ str); $ clen0; for ($ i0; $ I $ strlen; $ I ++, $ clen ++) {if ($ clen $ start + $ len) break; if (ord (substr ($ str, string truncation function start function csubStr ($ str, $ start, $ len)
{
$ Strlen = strlen ($ str );
$ Clen = 0;
For ($ I = 0; $ I <$ strlen; $ I ++, $ clen ++)
{
If ($ clen >=$ start + $ len)
Break;
If (ord (substr ($ str, $ I, 1)> 0xa0)
{
If ($ clen> = $ start)
$ Tmpstr. = substr ($ str, $ I, 2 );
$ I ++;
}
Else
{
If ($ clen> = $ start)
$ Tmpstr. = substr ($ str, $ I, 1 );
}
}
Return $ tmpstr;
}
// ------------------------------ String truncation function end -------------------------------------------
/* Usage:
$ Str = csubStr ("What should I do if the ipod is so dazzling? ", 0, 20 );
Echo $ str;
?>
Function csubStr ($ str, $ start, $ len) {$ strlen = strlen ($ str); $ clen = 0; for ($ I = 0; $ I $ strlen; $ I ++, $ clen ++) {if ($ clen = $ start + $ len) break; if (ord (substr ($ str ,...