- <?php
- function getServerConfig($val){
- return constant("SERVER_".$val);
- }
- define("SERVER_NAME", "localhost");
- echo getServerConfig("NAME");
- // localhost
- ?>
--------------------------------------------------------------------------------------------
mixed constant ( string $name )
3.라인
$name 문자열의 이름을 갖는 상수의 값을 반환합니다.
'php5 > 변수관련함수' 카테고리의 다른 글
변수 눈에 보이는 문자 확인 - bool ctype_graph ( string $text ) (0) | 2013.12.23 |
---|---|
변수 숫자 확인 - bool ctype_digit ( string $text ) (0) | 2013.12.23 |
변수 제어문자 확인 - bool ctype_cntrl ( string $text ) (0) | 2013.12.23 |
변수 알파벳 확인 - bool ctype_alpha ( string $text ) (0) | 2013.12.23 |
변수 알파벳이거나 숫자 확인 - bool ctype_alnum ( string $text ) (0) | 2013.12.23 |