Header Ads

PHP 상수와 예약상수 정리


// 특징 = $ 없음, 보통 대문자로 표기

// 상수정의
define("A", 1.9);
echo A;

// 마법상수
echo __LINE__;
echo __FILE__;
echo __FUNCTION__;
echo __CLASS__;
echo __METHOD__;

// 예약상수
// http://kr.php.net/manual/kr/reserved.constants.php
echo PHP_VERSION;
echo PHP_MAJOR_VERSION;
echo PHP_MINOR_VERSION;
echo PHP_RELEASE_VERSION;
echo PHP_VERSION_ID;
echo PHP_DEBUG;
echo PHP_MAXPATHLEN;
echo PHP_OS;
echo PHP_SAPI;
echo PHP_EOL;
echo PHP_INT_MAX;
echo PHP_INT_SIZE;
echo DEFAULT_INCLUDE_PATH;
echo PEAR_INSTALL_DIR;
echo PEAR_EXTENSION_DIR;
echo PHP_EXTENSION_DIR;
echo PHP_PREFIX;
echo PHP_BINDIR;
echo PHP_LIBDIR;
echo PHP_DATADIR;
echo PHP_SYSCONFDIR;
echo PHP_LOCALSTATEDIR;
echo PHP_CONFIG_FILE_PATH;
echo PHP_CONFIG_FILE_SCAN_DIR;
echo PHP_SHLIB_SUFFIX;
echo PHP_OUTPUT_HANDLER_START;

No comments

Copyright 2016, minki. All rights reserved. Powered by Blogger.