Create A New Class And Create An Instance Then Use Its Property And Method

<?php
class Dog
{
  var $name;  function bark()
  {
    print "Woof!";
  }
}$pooch = new Dog;$pooch -> name = "new name";print $pooch -> name . " says ";$pooch -> bark();?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.