Class: String
Source Location: /php/lang/String.php
Class String
Class Overview
|
문자열 유틸리티 클래스
매칭테이블 String 메소드 => 문자열함수
addcslashes => addcslashes
addslashes => addslashes
bin2hex => bin2hex
chop => chop
chr => chr
count_chars => count_chars
entity_encode => htmlentities
entity_decode => html_entity_decode
explode => explode
implode => implode
join => join
ltrim => ltrim
md5 => md5
nl2br => nl2br
ord => ord
parse => parse_str
print => print
printf => printf
rtrim => rtrim
similar => similar_text
soundex => soundex
sprintf => sprintf
sscanf => sscanf
ireplace => str_ireplace
pad => str_pad
repeat => str_repeat
replace => str_replace
rot13 => str_rot13
shuffle => str_shuffle
count_split => str_split
word_count => str_word_count
casecmp => strcasecmp
cmp => strcmp
coll => strcoll
strip => strip_tags
stripcslashes => stripcslashes
ipos => stripos
stripslashes => stripslashes
istr => stristr
len => strlen
natcasecmp => strnatcasecmp
natcmp => strnatcmp
ncasecmp => strncasecmp
ncmp => strncmp
pbrk => strpbrk
pos => strpos
last_string => strrchr
reverse => strrev
reverse_ipos => strripos
reverse_pos => strrpos
first_string => strstr
lower => strtolower
upper => strtoupper
translate => strtr
sub_compare => substr_compare
sub_count => substr_count
sub_replace => substr_replace
substring => substr
trim => trim
ucfirst => ucfirst
ucwords => ucwords
wrap => wordwrap
iconv => iconv
base64_encode => base64_encode
base64_decode => base64_decode
build_query => http_build_query
parse_url => parse_url
rawencode => rawurlencode
rawdecode => rawurldecode
urlencode => urlencode
urldecode => urldecode
highlight => highlight_string
phpstrip => php_strip_whitespace
constant => constant
split => split
spliti => spliti
number => number_format
money => money_format
pmatch_all => preg_match_all
pmatch => preg_match
preg_qoute => preg_qoute
preplace_callback => preg_replace_callback
preplace => preg_replace
psplit => preg_split
Located in /php/lang/String.php [line 107]
PObject
|
--String
Author(s):
Information Tags:
|
Methods
|
Inherited Properties, Constants, and Methods
Method Summary
| static
string
|
cut() |
문자열 자르기 (수정 필요) php_mbstring.dll 로드 필요 |
| static
string
|
getEUCKR() |
EUC-KR 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재) |
| static
string
|
getUTF8() |
UTF-8 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재) |
| String |
r() |
참조가 아닌 상태 함수를 쓸 때 자동으로 참조형태로 전환 |
Methods
static string cut(
string
$str, int
$length, [string
$subfix = "..."]
)
|
|
문자열 자르기 (수정 필요) php_mbstring.dll 로드 필요
Parameters:
|
string |
$str: |
문자열 |
|
int |
$length: |
자르는 길이 |
|
string |
$subfix: |
뒤에 붙을 문자열, 기본값 "..." |
API Tags:
static string getEUCKR(
string
$str, [string
$encoding = 'UTF-8']
)
|
|
EUC-KR 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)
Parameters:
|
string |
$str: |
변환될 문자열 |
|
string |
$encoding: |
이전 인코딩 |
API Tags:
static string getUTF8(
string
$str, [string
$encoding = 'CP949']
)
|
|
UTF-8 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)
Parameters:
|
string |
$str: |
변환될 문자열 |
|
string |
$encoding: |
이전 인코딩 |
API Tags:
static array matchTag(
string
$tagName, string
$subject, [boolean
$isOne = true]
)
|
|
태그 비교, 생성
Parameters:
|
string |
$tagName: |
태그 이름 |
|
string |
$subject: |
검색될 문자열 |
|
boolean |
$isOne: |
true : One 태그, false : Two 태그 |
API Tags:
| Return: | tag : 태그 이름, body : 매칭 문자열, id : 아이디, attribute : 속성, description : 내용, convert : 변환 내용 |
| Access: | public |
static array matchTagCallBack(
string
$tagName, string
$subject, boolean
$isOne, callback
$callback
)
|
|
태그 생성
callback 함수는 기본적으로 attribute, description 을 이용해서 convert를 생성하는 함수이다. 기본 형태는 function callback_func(&$obj) {
$obj['convert'] = str_replace("\n", "<br>", $obj['description']);
}
callback 함수가 클래스의 메소드라면 class AAA {
function callback_func(&$obj) {
}
}
$class = new AAA;
array($class, 'callback_func');
해서 callback 함수 부분에 넣어 주면 된다.
Parameters:
|
string |
$tagName: |
태그 이름 |
|
string |
$subject: |
검색될 문자열 |
|
boolean |
$isOne: |
true : One 태그, false : Two 태그 |
|
callback |
$callback: |
callback 함수 |
API Tags:
| Return: | tag : 태그 이름, body : 매칭 문자열, id : 아이디, attribute : 속성, description : 내용, convert : 변환 내용 |
| Access: | public |
static string matchTagReplace(
string
$tagName, string
$subject, boolean
$isOne, callback
$callback
)
|
|
문자열 변환
Parameters:
|
string |
$tagName: |
태그 이름 |
|
string |
$subject: |
검색될 문자열 |
|
boolean |
$isOne: |
true : One 태그, false : Two 태그 |
|
callback |
$callback: |
callback 함수 |
API Tags:
| Return: | 변환된 $subject |
| Access: | public |
callback getFunction(
string
$method
)
|
|
실제 실행될 함수
Parameters:
|
string |
$method: |
실행될 함수 이름 |
API Tags:
| Return: | 콜백이름 |
| Access: | public |
int getPos(
string
$method
)
|
|
매개변수 위치 얻기
Parameters:
|
string |
$method: |
실행될 함수 이름 |
API Tags:
| Return: | 매개변수 위치 |
| Access: | public |
참조가 아닌 상태 함수를 쓸 때 자동으로 참조형태로 전환
API Tags:
String ref(
[bool
$is_ref = true]
)
|
|
현재 참조상태 전환
Parameters:
|
bool |
$is_ref: |
참조 상태, true이면 무조건 참조 적용, 기본값 true, |
API Tags:
void setFunctionList(
string
$name, string|array
$run, int
$pos
)
|
|
적용될 함수 설정
Parameters:
|
string |
$name: |
함수이름 |
|
string|array |
$run: |
callback |
|
int |
$pos: |
매개변수 위치 |
API Tags:
String __call(
$method,
$args
)
|
|
string 관련함수 자동실행
Parameters:
API Tags:
|
|