php回调函数中调用外部变量的方法

后端开发PHP 788

使用use关键词可以调用外部变量

$callback = function($val) use ($avg) { return $val < $avg; };

Post Comment