Constants are similar to variables, holding information to be accessed later, except that they are what they sound like-constant.In other words, once you have defined one, its value is set for the remainder of the program and cannot be altered.

$directory= ROOT_LOCATION;

Predefined Constants:

PHP comes ready-made with dozens of predefined constants that you generally will be unlikely to use as a beginner to PHP. However, there is a few-know as the magic constants-that you will find useful. the names of the magic constants always have two underscores at the beginning and two at the end.

Translate »