class Score
{
var $score;
var $name;
var $dept;
var $date;
function Score($score, $name, $dept, $date)
{
$this->scores = ($score);
$this->name = ($name);
$this->dept = ($dept);
$this->date = ($date);
}
function return_score(){
return $this->scores;
return $this->name;
return $this->dept;
return $this->date;
}
}
$newscore = new Score("131313","James", "Marketing", "19/05/2008");
echo $newscore->return_score();
上述代碼僅回顯131313.我剛開始學習OO PHP,所以請輕鬆點!完全失去,所以任何幫助將不勝感激。只返回一個元素,OO PHP
你想要什麼輸出?看起來你想要所有的變量,但不知道。 – philistyne 2008-11-24 11:33:46