PHP » Miscellaneous » define()

Syntax:
void define(string name, mixed value [, bool no_case])
name
Name of the constant.
value
Value of the constant.
no_case
Whether the name of the constant should be case insensitive.

Defines a constant.

Constants are used to hold values that will not change during the execution of a script. This function creates a constant and assigns a value to it. Unlike variables, constants are not accessed using a dollar sign. It is not possible to define constant arrays. The optional parameter no_case can be used to make the name of the constant case insensitive. By default, constants are case sensitive.

Examples

Code:
<?php

define("MAX_MAILBOX_SIZE", 10000);
print "MAX_MAILBOX_SIZE: " . MAX_MAILBOX_SIZE . "<br>";

?>
Output:
MAX_MAILBOX_SIZE: 10000
Explanation:

Note that a dollar sign should not be used to access a constant.

See Also: