How do you define a constant?

Ads

 
 

Share on Google+Share on Google+

brijesh
How do you define a constant?
1 Answer(s)      6 years and 11 months ago
Posted in : PHP

How do you define a constant in php?

Ads
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.


Ads