Warning: array_filter() expects parameter 2 to be a valid callback

Warning:  array_filter() expects parameter 2 to be a valid callback, function 'checkMonth' not found or invalid function name in path\to\xxxModel.php on line 36

��������ص�CodeƬ�� - php�汾��5.6��

function checkMonth($v){
    return $v == $this->month;
}
function getByMonth($month){
    $ret = $this->allRet;
    $this->month = isset($month)?$month:date("m");
    return array_filter($ret, "checkMonth");
}


ת������������ģ����Բ������Dz���PHP�汾�����⣺

function getCourseByMonth($month){
    $ret = $this->allRet;
    $month = isset($month)?$month:date("m");
    return array_filter($ret, function($item) use($month){
        return date("m", strtotime($item[1])) == $month;
    });
}


���ij��� ��lybing�� ���ͣ�����ر����˳���http://lybing.blog.51cto.com/3286625/1787870

你可能感兴趣的:(Warning: array_filter() expects parameter 2 to be a valid callback)