摘要: 首先需要知道 const 常量是什么? 常量使用修饰符 const定义,一经定义,不能修改。 常量名称必须是大写: const EXIST_HT = '6666'; 常量的使用规则: 1. 定义后,应该马上赋初始值。 2. 不能用public 、private、protected修饰。 3. 在本类 阅读全文
posted @ 2020-03-24 17:17 blog_zss小帅-博客猿 阅读(790) 评论(0) 推荐(0) 编辑
摘要: 概念: 静态属性空间,定义静态属性 protected static $class = "班级"; <?php Class User{ protected static $class = "班级"; //静态属性 //调用方法1 public function getClass1(){ return 阅读全文
posted @ 2020-03-24 14:36 blog_zss小帅-博客猿 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 概念: $this:可以读取到类里面的属性,还可以读取到方法; 不管生成的对象名称是什么,$this只指向当前对象。 <?php Class User{ protected $name; public function getName($name){ return $this-> name = $n 阅读全文
posted @ 2020-03-24 13:42 blog_zss小帅-博客猿 阅读(819) 评论(0) 推荐(0) 编辑
摘要: 概念: 类:是由属性和方法构成的 对象:是通过类生成出来的 <?php Class User{ public $name="z"; //类的属性 protected $age; //类的属性 public function getName($name){ //方法 return $this->nam 阅读全文
posted @ 2020-03-24 13:33 blog_zss小帅-博客猿 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 这种情况通常是因为在调用的时候,package参数有问题导致; 最可能的原因是:你在测试的权限不够不是开发者权限,获取小程序的oppid失败,缺少oppid所以获取不到prepay_id=''的值 wx.requestPayment中package参数必须是package:"prepay_id=wx 阅读全文
posted @ 2020-03-24 09:14 blog_zss小帅-博客猿 阅读(4362) 评论(0) 推荐(0) 编辑