【发布时间】:2010-04-09 17:00:12
【问题描述】:
我在使用带变量的 functions.php 文件时遇到问题
$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>';
}
我无法访问 $comment_index,因此我无法从函数中设置或获取它。我应该怎么做才能解决这个问题?
真诚的
【问题讨论】: