<?php
/*方法的参数*/
class MyClass{
private $times;
function __construct(){
$this->times=date("Y-m-d H:i:s");
}
function action($myname=array(),$action,$address="广场"){
foreach($myname as $value){
$name.=$value;
}
return "[".$this->times."]".$name."总共".count($myname)."个人".$action."地点为:".$address;
}
}
/*实例化类*/
$class=new MyClass();
echo $class->action(array("欧阳冬, ","小明"),"正在游戏。");
?>