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 is ltrim?

518


How arrays are used in php?

556


Tell me how do you execute a php script from the command line?

520


What is the difference between rest and soap?

574


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

529






Is not null mysql?

547


Is array empty php?

506


How to convert strings in hex format?

568


What is the use of callback in php?

517


What happens if an expected input field was not submitted?

531


In php, how to redirect from one page to another page?

517


Which PHP function would you use to send an email?

604


What is string and its function?

518


How is it possible to return a value from a function?

542


What are the new features in php 7?

506