September 2001
Intermediate to advanced
768 pages
32h 45m
English
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. ...
Read now
Unlock full access