Cut Chinese characters – mb_substr

mb_strlen($title, 'utf-8')
mb_substr($value['summary'], 0, 110, 'utf-8')

 

$title = $row['title'];
if(mb_strlen($title, 'utf-8') > $title_limit){
	$title = mb_substr($title, 0, $title_limit, 'utf-8') . '...';
}
//60 chinese characters
$str = '經典布標中筒雪靴經典布標中筒雪靴經典布標中筒雪靴經典布標中筒雪靴經典布標中筒雪靴經典布標中筒雪靴經典布標中筒雪靴經典布標';
strlen($str);//180
mb_strlen($str, 'utf-8');//60

substr($str, 0, 20);//經典布標中筒��
mb_substr($str, 0, 20, 'utf-8');//經典布標中筒雪靴經典布標中筒雪靴經典布標(20)

 

Reference:

  1. http://hi.baidu.com/freemandomrerr/item/f2b0ace43355c90f8c3ea8d4