Constants Example

PI: 3.14159

Gravity: 9.8

Constants in PHP are like variables, but once they are defined, their values cannot change. They are defined using the define() function or the const keyword. Unlike variables, constants do not start with a dollar sign ($) and are always globally accessible.

Constants Code