How do you define a constant?

How do you define a constant in php?

View Answers

November 13, 2010 at 4:16 PM

Hi,

define("Name", "Deepak");

echo Name;  // Outputs Deepak


define("Name", "Ravi");

echo Name;  // Outputs Deepak

Means once you declair the define a constant value that will become every time it will not take new value or it will not redeclair.if you want change in value then declair the variables for that purpose.









Related Tutorials/Questions & Answers:
Advertisements