Re: [PHP4BETA] suggestion for new function str_change(string str,arraytranstable [,bool reverse])
| From: | Christian Schneider | Date: | Sat, 20 Nov 1999 14:09:23 +0000 |
| Subject: | Re: [PHP4BETA] suggestion for new function str_change(string str,arraytranstable [,bool reverse]) | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6578@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
> Yes, I like this. How about just naming it flip() ? Or perhaps
> array_flip()? There are all sorts of uses for this function on its
Sounds useful to me. What about efficiency? Could it be done efficiently? I
guess it would have to build a new Hashtable for the new keys (old values),
right? Nevertheless, it would be handy at times.
One point though is how would you resolve collisions? Creating arrays as values?
Probably the most feasible approach IMHO.
What about values that are arrays or objects?
Just my $.02,
- Chris
--
Chris Schneider, mailto:cschneid@relog.ch
Computers are not intelligent. They only think they are.