Loading…

How to make a class in PHP?

We can define a class with keyword "class" followed by the name of the class.

 

Example :

class phpClass {
    public function test() {
       echo 'Test';
    }
}

Suggest An Answer

No suggestions avaliable!

Latest post from PHP interview questions

Ask Question