A constant is a name for a value that cannot change during the script.
define("SITE_NAME", "CodesInTech");
const TAX_RATE = 0.18;
Constants have no $ and are global automatically.
By convention, constant names are UPPERCASE.
PHP also has "magic constants" like __LINE__, __FILE__ and __DIR__.
💡 Key Takeaways: PHP Constants
Mastering PHP Constants helps you write clean and reliable PHP code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.