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

Answer Posted / saurabh rastogi

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

echo CONSTANT; // Outputs Hello world

Is This Answer Correct ?    46 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain me what are the 3 scope levels available in php and how would you define them?

724


List data types in PHP?

534


What should we do to be able to export data into an excel file?

510


Who is the father or inventor of php?

576


Tell me what kind of things have you done on the social side?

502






What is a php web application?

488


How to insert a line break in php string?

542


How can we upload a file in php?

528


How do you parse and process html/xml in php?

548


Is age nominal or ordinal?

507


What are the different tables(engine) present in mysql, which one is default?

504


What is the function in PHP do not return a timestamp?

563


How can we determine whether a php variable is an instantiated object of a certain class?

520


Is age a variable in research?

480


Which are the best start and end tags to use?

573