2081 10

BIT301 ยท 2081 ยท 5 marks

Write a PHP program to demonstrate use of constructor.

Write a PHP program to demonstrate use of constructor. [5]

Web Technology IIChapter 6: Object Oriented ProgrammingConstructors and initialization

A constructor is a special method in a class that is automatically called when an object is created. In PHP, the constructor method is defined using construct(). --- --- --- Feature Description ------ construct() Special method called automatically on object creation