PHP const Keyword

PHP continue Keyword
PHP clone Keyword

In this article, you will learn how to create a constant in PHP. The const keyword in PHP is used to create constants. Unlike with the define() function, constants created using the const keyword must be declared in the global scope.

examples of the CONST keyword

Example 1. In this example, we create a constant and print its value.

<?php
const MY_CONSTANT = 5;
echo MY_CONSTANT;
?>
PHP continue Keyword
PHP clone Keyword
en English
X
Scroll to Top