한

문자열 자르는 함수.. (뒷북 가능성 높음.. -_-)

· 2006-07-11 (화) 09:58:53 · 3835
mb_strimwidth
(PHP 4 >= 4.0.6, PHP 5)
mb_strimwidth -- Get truncated string with specified width

Description
string mb_strimwidth ( string str, int start, int width, string trimmarker [, string encoding])


mb_strimwidth() truncates string str to specified width. It returns truncated string.
If trimmarker is set, trimmarker is appended to return value.
start is start position offset. Number of characters from the beginning of string. (First character is 0)
trimmarker is string that is added to the end of string when string is truncated.
encoding is character encoding. If it is omitted, internal encoding is used.


================================================================
mb_strimwidth 함수 입니다..
멀티바이트 스트링 함수들이 굉장히 많더군요..

문자열좀 이쁘게 자르려고 안간힘 쓰다가 발견하고 그냥 이 함수 쓰기로 했습니다..
한줄이면 끝난다는 엄청난 잇점도 있고..
글자의 폭이 같은 폰트를 쓸 경우는 길이가 다듬지 않아도 거의 균일합니다..


ps. 멀티바이트 스트링 관련 함수들이 굉장히 많던데 성능면에서 효율적인지가 궁금합니다..
잘 아시는분 있으면 알려주세요.. ^^;;



http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=46975&sca=%C7%D4%BC%F6<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
JavaScript 06-07-20 조회 4,144
기타 06-07-20 조회 4,115
기타 06-07-20 조회 3,700
JavaScript 06-07-20 조회 5,047
기타 06-07-20 조회 4,340
기타 06-07-20 조회 4,724
기타 06-07-19 조회 3,581
JavaScript 06-07-19 조회 4,629
기타 06-07-19 조회 3,881
기타 06-07-19 조회 3,492
Flash 06-07-19 조회 3,851
JavaScript 06-07-19 조회 4,158
기타 06-07-19 조회 3,973
기타 06-07-19 조회 4,311
JavaScript 06-07-19 조회 8,527
기타 06-07-19 조회 3,609
Flash 06-07-19 조회 3,708
MySQL 06-07-19 조회 3,942
PHP 06-07-17 조회 4,105
기타 06-07-17 조회 4,301
기타 06-07-16 조회 4,888
기타 06-07-14 조회 4,318
MySQL 06-07-14 조회 4,600
MySQL 06-07-14 조회 4,451
JavaScript 06-07-14 조회 4,243
JavaScript 06-07-13 조회 4,668
PHP 06-07-13 조회 5,371
Flash 06-07-11 조회 3,835
Flash 06-07-11 조회 4,325
PHP 06-07-11 조회 3,836