mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
문자열 자르기 할 경우 iconv를 사용하지 않고 정규표현식으로만 처리하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4493 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
420d543853
commit
3400e6a0b1
1 changed files with 0 additions and 7 deletions
|
|
@ -200,13 +200,6 @@
|
|||
function cut_str($string, $cut_size, $tail='...') {
|
||||
if(!$string || !$cut_size) return $string;
|
||||
|
||||
if(function_exists('iconv')) {
|
||||
$unicode_str = iconv("UTF-8","UCS-2",$string);
|
||||
if(strlen($unicode_str) < $cut_size*2) return $string;
|
||||
$output_str = substr($unicode_str, 0, $cut_size*2);
|
||||
return iconv("UCS-2","UTF-8",$output_str).$tail;
|
||||
}
|
||||
|
||||
$arr = array();
|
||||
return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0].$tail : $string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue