通过清心醉

PHP类和对象的最简单介绍

<?php
$o=100; //架设值=$_POST
class CLASS_
{
protected $a;
function setA($_a) {
$this->a = $_a;
}
function getA() {
return $this->a;
}
}
$class = new CLASS_();
$class->setA($o); //给$_a赋值
echo $class->getA();
?>

关于作者

清心醉 administrator

发表评论

请输入验证码: