Skip to main content

PHP Constants

In this lesson, I'm going to show you the importance and to how to use the Constants. In PHP, a Constant is an identifier (name) fro a simple value. As the value cannot be changed, unlike to variable. A Constant name must start with a letter or underscore and no dollar sign before the constant name. And unlike variables, constants are automatically global across the entire script. How to set Constants In setting a constant, we’re going to use the define() function, and it takes a three parameters: First the parameter is used to define the name of the constant, and the second parameter is

Add new comment