<?php
class Page{
public $content;
public $title = 'My Web Site';
public $keywords = 'keywords';
public $buttons = array(
'Home' => 'home.php',
'Contact' => 'contact.php',
'Services' => 'services.php',
'Site Map' => 'map.php'
);
public function __set($name,$value){
$this->$name = $value;
print_r($this);
}
}
$page = new Page();
$page->__set('a333','12312');
echo $page->a333;
PHP利用可变函数动态扩增类的属性
最新推荐文章于 2024-08-15 15:00:52 发布