define

define -- Defines a named constant.

Description

int define(string name, mixed value, int [case_insensitive] );

Defines a named constant, which is similar to a variable except:

The name of the constant is given by name; the value is given by value.

The optional third parameter case_insensitive is also available. If the value 1 is given, then the constant will be defined case-insensitive. The default behaviour is case-sensitive; i.e. CONSTANT and Constant represent different values.

Example 1. Defining Constants

  1 
  2 <?php
  3 define ("CONSTANT", "Hello world.");
  4 echo CONSTANT; // outputs "Hello world."
  5 ?>
  6       

define() returns TRUE on success and FALSE if an error occurs.

See also defined() and the section on Constants.