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 / nilsoft

define("CONSTANT", "Its constant");

echo CONSTANT; // Outputs Its Constant

There is no need to use $ sign for it.
$ sign is used for declare variables.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is meant by pear in php?

1046


What are php expressions?

1153


Declare a new variable in php equal to the number 3;

993


What is the function of string in c?

1050


What are arguments in php?

1065


Does php require a web server?

1016


How to swap two variables without using 3rd temp variable.

962


Is php used anymore?

1025


What is the difference between characters  and #?

1129


What is whitespace in html?

1073


Which is not a file-related function in php?

1096


Can we override static method?

1015


Can php variables have numbers?

1056


Is nan in php?

1097


Explain what is the static variable in function useful for?

996