Mecha CMS

Helper functions.

map

Modify array values.

2.2.0

map(iterable $data, callable $fn);

Example:

$A = map([1, 2, 3, 4, 5], function($v, $k) {
    return $k . ':' . $v;
});

Result:

$A = [
    0 => '0:1',
    1 => '1:2',
    2 => '2:3',
    3 => '3:4',
    4 => '4:5'
];