Re: [PHP-DEV] Proposal for new array_map function to pass in keys

2013-06-08 Thread Sherif Ramadan
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

Re: [PHP-DEV] Proposal for new array_map function to pass in keys

2013-06-08 Thread Pierre du Plessis
> 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)