class SetterGetterExample{
private $a=1;
public function get_a(){
//log_user_ip_address
return $this->a;
}
public function set_a($value){
$this->a=$value;
}
}
$example=new SetterGetterExample();
//echo $example->a;
echo $example->get_a();
$example->set_a(15);
echo "
";
echo $example->get_a();
?>
Dynamically set and get variable values. This is an abstract class that can be used to dynamically add variables to any class.
No comments:
Post a Comment