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 does == mean in php?

522


What is form validation in php?

526


What is basename php?

517


Can we embedded directly PHP code into XHTML document? State Whether True or False?

1262


What is the functionality of the functions strstr() and stristr()?

525






What is cookies php?

522


How to move uploaded files to permanent directory?

534


Explain how can php and javascript interact?

548


What is php form validation?

555


Is php object oriented?

510


When are you supposed to use endif to end the conditional statement?

536


What does the unset() function means?

591


What are include() and require() functions?

519


What are the steps involved to run php?

575


Does php have a future?

511