About
See define
Articles Related
Example
- Define
define('MY_ENV', getenv('MY_ENV'));
- Defined
defined('MY_ENV')
- Get
# Static
MY_ENV
# or Dynamic
constant('MY_' . 'ENV');
case-sensitivity
define("CONSTANT", "Hello world."); // The third parameter defaults to FALSE, meaning that the constant is case-sensitive.
echo CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.
define("GREETING", "Hello you.", true); // TRUE = case-insensitive.
echo GREETING; // outputs "Hello you."
echo Greeting; // outputs "Hello you."