- class emp
- {
- var $name;
- var $address;
- var $dept;
- function assign_info($n,$a,$d)
- {
- $this->name =$n;
- $this->state=$a;
- $this->dept=$d;
- }
- function display_info()
- {
- echo("
従業員名 : $this-> ;name");
- echo("
州 : $this->state");
- echo("
部門 : $this->dept");
- }
- }
- $empobj = new emp;
- $empobj->assign_info("kaka lname","California","Accounts");
- echo("
従業員情報の表示 ");
- echo("");
- $empobj->display_info();
- echo("");
- ?>
复制代码
|