php new 实例与new用法
Syntax: new Class 新建一个对象
使一个类的新实例。一个类的实例称为对象。
范例
class MyClass
{
var $s = "Hello World";
function getProperty() {
return $this->s;
}
}
$a = new MyClass;
$a->s = "Have a nice day";
print $a->getProperty();
//输出值
//Have a nice day
教程地址:http://www.phprm.com/function/d2bb062666da4a5e8e4adea59bb0b2de.html
欢迎转载!但请带上文章地址^^