On Sat, Jun 8, 2013 at 3:13 AM, Pierre du Plessis wrote:
>
> function my_call_back($key, $value) {
>> return array($value, strlen($value));
>> }
>> $array = str_word_count("PHP is lots of fun!");
>> $array = array_map_key('my_call_back', $array);
>>
>>
>> The result would be the following arra
> function my_call_back($key, $value) {
> return array($value, strlen($value));
> }
> $array = str_word_count("PHP is lots of fun!");
> $array = array_map_key('my_call_back', $array);
>
>
> The result would be the following array:
>
> array(5) {
> ["PHP"]=>
> int(3)
> ["is"]=>
> int(2)
I'm proposing a new function similar to the implementation of array_map
that allows us to apply a user-supplied callback to every element in the
array with the addition of the callback being passed the key as well as the
value of each element. Additionally, I would like to propose that the
callback