码迷,mamicode.com
首页 > 其他好文 > 详细

中文截取无乱码

时间:2015-06-01 22:22:55      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

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

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

     }  

 

中文截取无乱码

标签:

原文地址:http://www.cnblogs.com/hgj123/p/4544851.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!