Public Fields

 
    <?php   class Staff
   {
      public $name;
   }   $employee = new Staff();
   $employee->name = "Joe";
   $name = $employee->name;
   echo "www.w3mentor.com: $name";?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.