Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to Define a Constant in PHP? Is $ symbol necessary?

Answer Posted / abhishek baranwal

define("CONSTANT", "Hello world.");

echo CONSTANT; // Outputs Hello world


define("CONSTANT", "New Value");

echo CONSTANT; // Outputs Hello world

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.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of indexes in php?

1089


What does the scope of variables mean?

1005


Will php die?

1003


Which function is used to strip whitespace?

1015


What is traits? How it is used in php?

1096


How could I install codeignitor ?

2276


What is difference between array_merge and array_combine?

1132


Tell me how to retrieve a cookie value?

1069


What is == and === in php?

956


How can you send http header to the client in php?

1055


What is $_ env in php?

1033


Why do we show php code in browser?

1116


What is list function with their uses.

1026


Why do we use interface in php?

1014


Tell me what is the difference between get and post?

1005