phpDocumentor php-lang
[ class tree: php-lang ] [ index: php-lang ] [ all elements ]

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:
Version:  1.0

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From PObject

PObject::__construct()
생성자
PObject::display()
객체 문자열을 출력
PObject::equals()
객체 비교 (수정 필요)
PObject::getClass()
PObject::getObjValue()
객체인지 아닌지 판별해서 PObject 형 객체이면 toString() 메소드로 문자열을 반환하고 일단 자료형이면 그 형태 그대로 리턴한다
PObject::isObject()
객체 확인
PObject::toString()
객체 문자열로 변환
PObject::__toString()
magic methods 추가 , toString() 의 값을 그대로 리턴한다.

[ Top ]
Constant Summary
POS_FIRST   첫번째 매개변수
POS_MAX   마지막 매개변수
POS_SECOND   두번째 매개변수
POS_THIRD   세번째 매개변수
POS_ZERO   매개변수로 적용 안함

[ Top ]
Method Summary
static string   cut()   문자열 자르기 (수정 필요) php_mbstring.dll 로드 필요
static string   getEUCKR()   EUC-KR 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)
static string   getUTF8()   UTF-8 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)
static array   matchTag()   태그 비교, 생성
static array   matchTagCallBack()   태그 생성
static string   matchTagReplace()   문자열 변환
String   __construct()  
callback   getFunction()   실제 실행될 함수
int   getPos()   매개변수 위치 얻기
void   init()  
void   isFunction()  
String   r()   참조가 아닌 상태 함수를 쓸 때 자동으로 참조형태로 전환
String   ref()   현재 참조상태 전환
void   setFunctionList()   적용될 함수 설정
void   toString()  
String   __call()   string 관련함수 자동실행
void   __get()  

[ Top ]
Methods
static method cut  [line 316]

  static string cut( string $str, int $length, [string $subfix = "..."]  )

문자열 자르기 (수정 필요) php_mbstring.dll 로드 필요

Parameters:
string   $str:  문자열
int   $length:  자르는 길이
string   $subfix:  뒤에 붙을 문자열, 기본값 "..."

API Tags:
Access:  public


[ Top ]
static method getEUCKR  [line 345]

  static string getEUCKR( string $str, [string $encoding = 'UTF-8']  )

EUC-KR 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)

Parameters:
string   $str:  변환될 문자열
string   $encoding:  이전 인코딩

API Tags:
Access:  public


[ Top ]
static method getUTF8  [line 332]

  static string getUTF8( string $str, [string $encoding = 'CP949']  )

UTF-8 형태로 문자열 변환 (php5는 iconv 모듈 기본 탑재)

Parameters:
string   $str:  변환될 문자열
string   $encoding:  이전 인코딩

API Tags:
Access:  public


[ Top ]
static method matchTag  [line 364]

  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


[ Top ]
static method matchTagCallBack  [line 431]

  static array matchTagCallBack( string $tagName, string $subject, boolean $isOne, callback $callback  )

태그 생성

callback 함수는 기본적으로 attribute, description 을 이용해서 convert를 생성하는 함수이다. 기본 형태는

  1.   function callback_func(&$obj{
  2.         $obj['convert'str_replace("\n""<br>"$obj['description']);
  3.     }

callback 함수가 클래스의 메소드라면

  1.   class AAA {
  2.      function callback_func(&$obj{
  3.  
  4.         }
  5.     }
  6.  
  7.   $class new AAA;
  8.   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


[ Top ]
static method matchTagReplace  [line 454]

  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


[ Top ]
Constructor __construct  [line 146]

  String __construct( [ $string = '']  )

Parameters:
   $string: 

API Tags:
Access:  public


Redefinition of:
PObject::__construct()
생성자

[ Top ]
getFunction  [line 280]

  callback getFunction( string $method  )

실제 실행될 함수

Parameters:
string   $method:  실행될 함수 이름

API Tags:
Return:  콜백이름
Access:  public


[ Top ]
getPos  [line 265]

  int getPos( string $method  )

매개변수 위치 얻기

Parameters:
string   $method:  실행될 함수 이름

API Tags:
Return:  매개변수 위치
Access:  public


[ Top ]
init  [line 153]

  void init( )


API Tags:
Access:  public


[ Top ]
isFunction  [line 212]

  void isFunction( $name  )

Parameters:
   $name: 

API Tags:
Access:  public


[ Top ]
r  [line 247]

  String r( )

참조가 아닌 상태 함수를 쓸 때 자동으로 참조형태로 전환


API Tags:
See:  String::ref()
Access:  public


[ Top ]
ref  [line 235]

  String ref( [bool $is_ref = true]  )

현재 참조상태 전환

Parameters:
bool   $is_ref:  참조 상태, true이면 무조건 참조 적용, 기본값 true,

API Tags:
See:  String::r()
Access:  public


[ Top ]
setFunctionList  [line 208]

  void setFunctionList( string $name, string|array $run, int $pos  )

적용될 함수 설정

Parameters:
string   $name:  함수이름
string|array   $run:  callback
int   $pos:  매개변수 위치

API Tags:
Access:  public


[ Top ]
toString  [line 482]

  void toString( )


API Tags:
Access:  public


Redefinition of:
PObject::toString()
객체 문자열로 변환

[ Top ]
__call  [line 167]

  String __call( $method, $args  )

string 관련함수 자동실행

Parameters:
   $method: 
   $args: 

API Tags:
Access:  public


[ Top ]
__get  [line 216]

  void __get( $key  )

Parameters:
   $key: 

API Tags:
Access:  public


[ Top ]
Constants
POS_FIRST = 0 [line 125]

첫번째 매개변수


[ Top ]
POS_MAX = 1000 [line 140]

마지막 매개변수


[ Top ]
POS_SECOND = 1 [line 130]

두번째 매개변수


[ Top ]
POS_THIRD = 2 [line 135]

세번째 매개변수


[ Top ]
POS_ZERO = -1 [line 120]

매개변수로 적용 안함


[ Top ]

Documentation generated on Fri, 09 Apr 2010 11:57:35 +0900 by phpDocumentor 1.4.3