demo1:
class test{
const PROVINCE = ‘安徽’;
public function getinfo(){
return self::PROVINCE;
}
}
$model = new test();
$info = $model->getinfo();
echo $info;
demo2、
class test2{
const CITY = ‘淮南’;
public static function getinfo(){
return self::CITY;
}
}
echo test2::getinfo();