class bbsObj{
var $num;
var $dates;
var $title;
var $counts;
function bbsObj($num, $datas, $title, $counts) {
$this->num = $num;
$this->dates = $num;
$this->title = $title;
$this->counts = $counts;
}
function getNum(){
return $this->num;
}
function getDates(){
return $this->dates;
}
}
$bbsObject = new bbsObj("1", "2012", "title", "0");
$data = array();
$data[0] = $bbsObject;
echo($data[0]->getNum());
有没有办法表达arraylist<课程>输入php?
我相信echo应该返回“1”,但不知道为什么它什么都不返回而且什么也没有显示。
为什么我在回声时什么也得不到?