O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data Types, Constants, and Variables

These functions check the status of a variable, change its type, or return a value as a particular data type.

boolean define(string name, value, boolean non_case_sensitive)

The define function creates a constant, which is essentially a variable that may be set only once. The value argument may be a string, integer, double, or boolean. It may not be an array or object. The non_case_sensitive argument is optional. By default, constants are case sensitive, which is the same as with variables.

If the constant cannot be created for some reason, FALSE will be returned. If you wish to check that a constant is defined, use the defined function.

It is customary to name constants using all uppercase letters, as is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required