천

문자열 자르는 함수 입니다.

· 2015-11-15 (일) 17:02:51 · 2770

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

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

개발자팁

5,404건

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

+
분류 제목 글쓴이 날짜 조회
PHP 15-11-23 조회 7,646
PHP 15-11-23 조회 2,856
PHP 15-11-23 조회 3,069
PHP 15-11-21 조회 3,002
PHP 15-11-21 조회 3,038
PHP 15-11-21 조회 2,392
PHP 15-11-20 조회 2,766
PHP 15-11-20 조회 2,607
PHP 15-11-20 조회 3,095
PHP 15-11-18 조회 3,207
PHP 15-11-18 조회 3,491
PHP 15-11-18 조회 3,164
PHP 15-11-17 조회 1.3만
PHP 15-11-17 조회 3,179
PHP 15-11-17 조회 2,760
PHP 15-11-16 조회 2,564
PHP 15-11-16 조회 2,923
PHP 15-11-16 조회 4,044
PHP 15-11-15 조회 2,771
PHP 15-11-15 조회 2,187
PHP 15-11-15 조회 3,511
정규표현식 15-11-12 조회 8,100
웹서버 15-11-11 조회 3,013
jQuery 15-11-09 조회 3,754
jQuery 15-11-09 조회 3,312
PHP 15-11-09 조회 3,145
PHP 15-11-09 조회 2,654
PHP 15-11-09 조회 3,875
JavaScript 15-11-09 조회 4,343
PHP 15-11-06 조회 9,171