我想在
array_map
的匿名函数中调用我的一个对象方法。目前我收到了预期的错误提示:
致命错误:在非对象上下文中使用 $this...
我知道我为什么会收到这个错误,但我不知道如何实现我想要的... 有人有任何建议吗?
这是我当前的代码:
// Loop through the data and ensure the numbers are formatted correctly
array_map(function($value){
return $this->some_method($value,'value',false);
},$this->mssql->data[0]['results'][0]);
$this
的支持。 - igorw