Array_filter in the context of an object, with private callback

前端 未结 1 506
深忆病人
深忆病人 2021-02-19 01:54

I want to filter an array, using the array_filter function. It hints at using call_user_func under water, but does not mention anything about how to use within the context of a

1条回答
  •  遇见更好的自我
    2021-02-19 02:31

    Yes:

    return array_filter($this->get_docs(), array($this, 'filter_item'));
    

    See the documentation for the callback type.

    0 讨论(0)
提交回复
热议问题