Constants are used in a PHP project whose value never changes. Such values can be defined as constant variables. The only important point we need to remember, PHP Constant variable values can not be overwritten.Such variables are defined once and remains same as long as website exists.
PHP constant can be defined using the function define.
Define function takes two argument, first one is the constant variable name and second one is the value.
Through out the website, the website name and home page url are going to remain same irrespective of the page a user is in.
Lets define constant variable for website name and home page url.
This is the way we define constant in php using define function.