Use poroperty set : Properties set : Class PHP Source Code


PHP Source Code » Class » Properties set »

 

Use poroperty set




<?php
   class Staff
   {
      var $name;
      function __set($propName, $propValue)
      {
         echo "Nonexistent variable: $$propName!";
      }
   }

   $employee = new Staff();
   $employee->name = "Joe";
   $employee->title = "Developer";

?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» Properties set