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());
有什么方法可以在 php 中表达 arraylist < class > 类型?
我相信 echo 应该返回“1”,但不知道为什么它什么也不返回,什么也不显示。
为什么我在回声时什么也得不到?