Accum - maximiliamus/weby-sloth GitHub Wiki

Accumulates the values of a column. The values are accumulated in the resulting array.

$sloth = Sloth::from($data)
    ->group('foo', 'baz')
    ->accum();
$sloth->print();
foo     baz
one     [1,...]
two     [4,...]
print_r($sloth->fetch());
Array
(
    [0] => Array
    (
        [foo] => one
        [baz] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )
    )
    [1] => Array
    (
        [foo] => two
        [baz] => Array
        (
            [0] => 4
            [1] => 5
            [2] => 6
            [3] => 7
        )
    )
)
⚠️ **GitHub.com Fallback** ⚠️