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

Answer Posted / vaneet badhan

define(my,60);

echo my;

output will be 60.

define(my,vaneet);

echo my;

output will be vaneet

Is This Answer Correct ?    7 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a dependant variable mean?

565


Can you explain, when to use if-else if-else over switch statements?

537


What is the best way to change the key without changing the value of a php array element?

553


Why does php start with variables?

550


What are the Formatting and Printing Strings available in PHP?

587






How do you count numbers in php?

501


What does php exit do?

530


What is use of in_array() function in php?

541


what is benefit of magento?

2035


What is config file in php?

538


What is the maximum size of a table in mysql?

539


What are advantages of .htaccess?

531


Explain what is the difference between session and cookie?

538


Explain what is meant by pear in php?

533


How to convert a character to an ascii value?

560