define

bool define(string name, mixed value, [integer case_insensitive]) 
name Name of the constant
value Value of the constant
case_insensitive Whether the constant name is case-insensitive

Defines a named constant.

Returns:

TRUE on success; FALSE otherwise

Description:

define() is used to define named constants. Constants are similar to variables, except for the following differences:

  • Once defined, a constant’s value cannot be changed.

  • Constant names do not need a leading dollar sign ($).

  • Once defined, a constant can be accessed regardless of scope. However, constants can only be accessed in a script after they have been defined.

  • Only scalar values (strings and numbers) can be represented as constants.

  • Like variables, constant names are case-sensitive. ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.