프리미엄 WP 테마 플러그인 무료 다운로드

Reply To: bbpress로 만든 게시판입니다

질문 제출 Forums Reply To: bbpress로 만든 게시판입니다


Word Cracker
Keymaster

수정:

function cut_str($str, $len, $suffix="…") 
{ 
    global $g4; 

    $s = substr($str, 0, $len); 
    $cnt = 0; 
    for ($i=0; $i<strlen($s); $i++) 
        if (ord($s[$i]) > 127) 
            $cnt++; 
    if (strtoupper($g4['charset']) == 'UTF-8') 
        $s = substr($s, 0, $len - ($cnt % 3)); 
    else 
        $s = substr($s, 0, $len - ($cnt % 2)); 
    if (strlen($s) >= strlen($str)) 
        $suffix = ""; 
    return $s . $suffix; 
} 

http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=288446