Menu Riverview Church

DEFINE

Defines a named constant

SYNTAX

define ( string $name , mixed $value [, bool $case_insensitive = FALSE ] ) : bool

PARAMETERS

name

The name of the constant.

Note: It is possible to define() constants with reserved or even invalid names, whose value can (only) be retrieved with constant(). However, doing so is not recommended.

value

The value of the constant. In PHP 5, value must be a scalar value (integer, float, string, boolean, or NULL). In PHP 7, array values are also accepted.

Warning: While it is possible to define resource constants, it is not recommended and may cause unpredictable behavior.

case_insensitive

If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Constant represent different values.

Warning: Defining case-insensitive constants is deprecated as of PHP 7.3.0.

Note: Case-insensitive constants are stored as lower-case.

RETURN

Returns TRUE on success or FALSE on failure.

EXAMPLES

1

Hello World!

2

Hello World!
Hello World!

3

bird
cat
dog

PHP