2011년 12월 19일 월요일

PHP 변수관련함수

조건에 따른 분기문
연산자 ?:
사용예 ( $a == 1 ) ? "one" : "all"


constant( "SERVER_" . $value )
$value 문자열의 이름을 갖는 상수의 값을 반환

ctype_alnum( string text )
( text문자열이 알파벳 || 숫자 )? true : false

ctype_alpha( string text )
( text 문자열이 알파벳 ) ? true : false

ctype_cntrl( string text )
( text 문자열이 제어문자( 엔터( \n ), 탭( \n ) ) ) ? true : false

ctype_digit( string text )
( text 문자열이 숫자 ) ? true : false

ctype_graph( string text )
( text 문자열이 눈에 보이는 문자( 탭( \t ), 엔터( \n ), 공백 제외 ) ) ? true : false

ctype_space( string text )
( text 문자열이 눈에보이지 않는 문자 ( 엔터, 탭, 공백 )) ? true : false

ctype_lower( string text )
( text 문자열이 알파벳 소문자 ) ? true : false

ctype_upper( string text )
( text 문자열이 알파벳 이면서 대문자 ) ? true : false

ctype_print( string text )
( 출력할수 있는 문자( 공백포함 ) 제어문자( \n, \t ) 제외 ) ? true : false

ctype_punct( string text )
( text 문자열이 기호문자 ) ? true : false

ctype_xdigit( string text )
( text 문자열이 16진수 문자( 알파벳 소문자 a~f, 숫자형 문자 ) ) ? true : false