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 differences between GET and POST methods in form submitting?

1087


Is server side a session?

988


What are super global variables in php?

1093


How do I sort numbers in php?

1114


What is php in simple words?

1063


Require_once(), require(), include(). What is difference between them?

1033


Does https prevent csrf?

968


Is php used for frontend or backend?

1056


How do you end a function in python?

1055


What is the difference between client-side and server-side programming?

1182


What is the main difference between asp net and php?

1073


Which function is used to read a single character from a file in PHP.

1096


What are the Advantages and Application Areas of PHP?

979


How check field is empty or not in php?

1099


Is php free to use?

1054