array_flip duplicate keys as arrays
| From: | Richard Lynch | Date: | Wed, 13 Sep 2006 16:39:20 +0000 |
| Subject: | array_flip duplicate keys as arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-241733@lists.php.net to get a copy of this message | ||
I figured somebody else must have needed this, so there'd have to be a
PHP function for it...
But I'm not finding it when I rtfm...
Given an array like this:
$t9 = array('F' => 'FIND', 'D' => 'FIND',
'E' =>'FIND', 'H' => 'HELP',
'I' => 'HELP');
I'm looking for a built-in function that returns this:
array('FIND' => array('F', 'D', 'E'),
'HELP'=>array('H', 'I'))
Or maybe I'm the only goofball that needs this?
Obviously I can write it with a loop.
But is there some quick built-in function I'm missing?
--
Like Music?
http://l-i-e.com/artists.htm