Constant

Updated: 10/02/2017 by Computer Hope

constConst or constant is a term used to describe data or a value that does not change in a specified amount of time, unlike a variable. For example, in a PHP script when a constant is defined it'll remain the same throughout the script. Below is an example how you'd define and use a constant.

define ('EXAMPLE', 'There is hope!\n');
echo 'Is there hope? ', EXAMPLE;

Entering the above code would return: "Is there hope? There is hope!" in a PHP page.

Tip: It's common and preferred that constants be created in all uppercase.

Programming terms, Read-only, Static, Variable