摘要:
php数据访问1.造连接对象$db = new MySQLi("localhost","root","123","test_123"); //("本地主机名","用户名","密码","数据库名")2.写SQL语句$sql="select * from student";3.执行SQL语句,返回结果集 阅读全文
摘要:
1.__tostring()方法输出对象时用来不报错,写在类里,必须有返回值class Ren{ public $name; public function __tostring() { return "该类是人类,name代表姓名"; }}$r = new Ren();echo $r;2.克隆对象 阅读全文
摘要:
1.静态*普通成员:属于对象的静态成员:属于类的关键字:staticclass FenBi{ public $length=10;//粉笔长度,普通成员 public static $color="红";//粉笔颜色,静态成员 public static function test() { echo 阅读全文