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

How does the identity operator === compare two values?

1168


What is php and features of php?

991


How to calculate the length of a string?

1117


What is isset and unset in php?

1034


What beforeFilter() is used?

1116


What was the old name of php?

1412


Which library is used in php to do various types of image work?

998


How to pass variables and data from php to javascript?

1041


Why is used in php?

964


Is php is dying?

962


What is mysql_fetch_object?

1054


What is the capacity of mysql database?

1086


Is php easier than javascript?

996


Which is true about the singleton design pattern?

943


What are sql injections, how do you prevent them and what are the best practices?

1063