public static function mapEntries(array $elements, $function)
    {
        $keys = array_keys($elements);
        $values = array_values($elements);
        return array_combine($keys, array_map($function, $keys, $values));
    }
public static function mapEntries(array $elements, $function)
    {
        $keys = array_keys($elements);
        $values = array_values($elements);
        return array_combine($keys, array_map($function, $keys, $values));
    }
public static function mapEntries ( array $ elements , $ function ) { $ keys = array_keys ( $ elements ) ; $ values = array_values ( $ elements ) ; return array_combine ( $ keys , array_map ( $ function , $ keys , $ values ) ) ; }
This method maps array values using the function which takes key and value as parameters.
Invokes the function for each value in the array. Creates a new array containing the values returned by the function.

Example:
<code>
$array = array('a' => '1', 'b' => '2', 'c' => '3');
$result = Arrays::mapEntries($array, function ($key, $value) {
return $key . '_' . $value;
});
</code>
Result:
<code>
Array
(
[a] => a_1
[b] => b_2
[c] => c_3
)
</code>

@param array $elements
@param callable $function
@return array
This method maps array values using the function which takes key and value as parameters . Invokes the function for each value in the array . Creates a new array containing the values returned by the function .