Create Class Instance

 
    <?php
class ClassName{
   var $var1;
   var $var2;
 
   function myfunction1(){
      $result = "$this->var1 and $this->var2";
      return $result;
   }
 
   function myfunction2(){
      $myfunction1 = $this->myfunction1();
      return $myfunction1;
   }
}$myclass = &new ClassName;$myclass->var1 = "A";
$myclass->var2 = "B";echo $myclass->myfunction1()."<br />";
echo $myclass->myfunction2()."<br />";
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.