//先删除掉非中文的字体 $str = preg_replace('/[^\x{4e00}-\x{9fa5}]/u', '', $str); //经过测试中文占3个篇幅 $re = chunk_split($str,3,","); //再利用explode将字符串分割为数组$re = explode(",",$re);
本文共 209 字,大约阅读时间需要 1 分钟。
//先删除掉非中文的字体 $str = preg_replace('/[^\x{4e00}-\x{9fa5}]/u', '', $str); //经过测试中文占3个篇幅 $re = chunk_split($str,3,","); //再利用explode将字符串分割为数组$re = explode(",",$re);
转载于:https://www.cnblogs.com/CyLee/p/5552668.html