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

Source: Internet
Author: User

Warning:array_filter () expects parameter 2 to BES a valid callback, function ' checkmonth ' not found or invalid function n Ame in path\to\xxxmodel.php on line 36

Here is the relevant code fragment-PHP version: 5.6:

function Checkmonth ($v) {return $v = = $this->month;}    function Getbymonth ($month) {$ret = $this->allret;    $this->month = isset ($month)? $month:d ate ("M"); Return Array_filter ($ret, "Checkmonth");}


Instead of using the anonymous method is normal, so do not know whether the PHP version of the problem:

function Getcoursebymonth ($month) {$ret = $this->allret;    $month = Isset ($month)? $month:d ate ("M");    Return Array_filter ($ret, function ($item) use ($month) {return date ("M", Strtotime ($item [1])) = = $month; });}


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.