How to use constants in PHP

preview_player
Показать описание
In this video training, you'll learn how to use constants in PHP. A constant is an identifier (name) for a simple value. The value cannot be changed during the script.
A valid constant name starts with a letter or underscore (no $ sign before the constant name).
Note: Unlike variables, constants are automatically global across the entire script.

You can download code of this video from my github repository:

Рекомендации по теме
Комментарии
Автор

hi sir,
u help me?
i created define into a different file.
and when i call it into class, i get error message like this 'Uncaught Error: Undefined constant'
currently i'm using php v 8.1

EkoAgustiawan
Автор

Pahd ne ka nahi he sir samjane ka he....

talha