中文截取无乱码

    /*
    *中文截取无乱码
    */
     function showsubstr_chinese($str, $start, $length = null) {  

          return join("",  array_slice( preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $start, $length));  

     }  

 

posted @ 2015-06-01 20:43  麦田守望者~  阅读(103)  评论(0编辑  收藏  举报