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