- array_filter: documentation ( source)
<?php
class Something
{
public function __construct()
{
// $this->current_user = Auth::get_user();
}
public function another_thing()
{
$groups = array_filter(array(0, 1, 5, 10, 50), function($item) {
return $item < $this->current_user->group;
});
}
}
$something = new Something();
$something->another_thing();