截取某个中文后的字符串

$offset = 'q2仅选中(1,2,3)||q2仅选中(1,2,3)则问卷失败';
function mb_str_split( $string ) {
// /u表示把字符串当作utf-8处理,并把字符串开始和结束之前所有的字符串分割成数组
return preg_split('/(?<!^)(?!$)/u', $string );
}
$a = mb_str_split($offset);
$index = array_search('则',$a);

$str = '';
for($i = $index;$i<=count($a)-1;$i++){
$str .= $a[$i];
}
echo $str;


exit ;

posted on 2018-03-15 17:09  会学习的猪  阅读(188)  评论(0编辑  收藏  举报

导航