1.

Which one of the following is the right way to define a constant?(a) constant PI = “3.1415”;(b) const $PI = “3.1415”;(c) constant PI = ‘3.1415’;(d) const PI = ‘3.1415’;I had been asked this question by my school teacher while I was bunking the class.I need to ask this question from Basics of Object-Oriented PHP- 1 topic in section Object-Oriented PHP of PHP

Answer»

Correct answer is (d) CONST PI = ‘3.1415’;

Explanation: Class CONSTANTS are created LIKE: const NAME = ‘VALUE’;



Discussion

No Comment Found

Related InterviewSolutions