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

What is the Pipe Symbol represented?

630


What does $_cookie means?

570


What is use of isset function in php?

595


What is the role of the .htaccess file in php?

550


What is chrome logger?

563






How do I install php and apache on windows 10?

520


Explain scalar type declarations in php7?

553


How to get ip address of a server in php?

553


Is php an api?

535


What is the difference between Session and Cookie?

587


What is new static in php?

540


What is htaccess? Why do we use this and where?

503


What is htaccess in php?

612


What is strlen function in php?

518


Tell me in php, objects are they passed by value or by reference?

539