0
$prev_dept = 0;
$comment_count = 0;
$comment_index = 0;
function setCommentCount($size){
$comment_count = $size;
}
function flowhub_comment($comment, $args, $depth) {
$comment_index ++;
if($depth > 1) {
$line = true;
}
echo '$prev_dept:' . $prev_dept.'<br>';
}
的functions.php文件的問題我不能訪問$ comment_index所以我不能設置也從一個函數中得到它。我應該怎麼做才能解決這個問題?
此致如實
謝謝,我認爲這很奇怪,因爲通常我使用私人,公共等......而在其他語言中,當您在課堂上工作時可能會獲得訪問權限。謝謝我會盡可能地標記你的答案(11分鐘) – Ayrton 2010-04-09 17:04:38
如果你對課程感到滿意,你可以在PHP中使用它們。然後你可以將這些變量放在類的範圍內,然後使它可以通過類方法訪問。 http://us.php.net/manual/en/language.oop5.basic.php – unholysampler 2010-04-09 17:14:34