Constants

Created using the define(); function

 

Classically UPPERCASE

 

  • Do NOT have $ sign before them
  • Can be used anywhere, regardless of scoping rules
  • Cannot be redefined or undefined once set
<?php
	define("POTATO", "My Name is Sanjay");

	echo POTATO;

	echo "<br><br>" ;

	define("TIME_NOW", time() );

	echo "The number of seconds since Epoch is: " . TIME_NOW;

?>

Leave a Reply