发表时间:2014-09-05来源:网络
<?php class person{ var $name; var $color; var $sex; var $age; function __construct($name,$age='',$sex='boy'){ $this->name = $name; $this->age = $age; $this->sex = $sex; $this->color = 'yello'; } function eat(){ echo $this->name.'要吃饭'; } function xinxi(){ echo $this->name.' is '.$this->sex.' and age is '.$this->age.' fuse is '.$this->color; } } ?>
<?php include('person.class.php'); $son = new person('cuihua',25,'girl');//此处的参数传递要和类的构造方法里面的参数顺序对应 //$son->xinxi();//cuihua is girl and age is 25 fuse is yello $son->name = '田妞'; $son->eat();//田妞要吃饭 ?>
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
PHP中的(++i)前缀自增 和 (i++)后缀自增
将视频设置为Android手机开机动画的教程
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2022-03-21
2014-09-05