2012年12月25日
摘要: <?class image { protected $img; protected $types = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 6 => 'bmp' ); public function __construct($img=''){ ... 阅读全文
posted @ 2012-12-25 11:39 hrc 阅读(251) 评论(0) 推荐(0)
摘要: (1)__construct() 是PHP内置的构造函数, 是同PHP 解析引擎自动调用的, 当实例化一个对象的时候,这个对象的这个方法首先被调用。例:class Test { function __construct() { echo "This is __construct function!"; } function Test() { echo "This is Test!"; } }$objTest = new Test; // 运行结果是“This is __construct function!”(2)__destory()是PHP内置的析构 阅读全文
posted @ 2012-12-25 11:07 hrc 阅读(125) 评论(0) 推荐(0)