테스트 사이트 - 개발 중인 베타 버전입니다

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

· 19년 전 · 2417
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>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
9921
28612
28611
28605
9920
JavaScript Samba 설정
9916
9915
28596
9906
28572
HTML if 23
28564
9898
24744
24742
24741
24736
28558
9896
9893
9892
9891
9890
28557
9889
9888
9887
9885
9884
28555
9883
9881
9880
9879
9878
9877
9876
9873
9871
9864
9840
9836
9834
9832
9830
9828
9826
9797
9754
9709
9686
9646
9634
9617
9615
9613
28553
9611
9607
24726
24725
24721
9569
9567
9550
9531
9527
28550
9493
9479
9431
9418
9372
9331
9267
9216
9215
9214
28549
28548
9213
28543
9211
9210
9208
24718
24706
24702
24701
24698
24695
9202
28540
24688
9194
24679
24674
24670
9193
9191
9190