PHP Constants



  • A Constant is a name for a simple value.
  • A Constant value cannot be changed during the execution.
  • A Constant name starts with a letter or underscore.
  • A Constant does not required $ sign before it is assigned.
  • A constant has global scope across the entire script.
  • A constant is set by define() function. It takes two parameters, in first parameter we define the constant 
  • name, & in the second parameter we define the value of the constant.



<?php
define("my_message", "i-Technophilia in the best website!");
echo my_message;
?>

0 comments:

Post a Comment