Mårten gustafsson wrote: > Is there anyone else than me that would find it useful to be able to do: > > <?php > $string = 'foo bar'; > $replacements = array( > 'foo' => 'FOO', > 'bar' => 'BAR'); > // Prints "FOO BAR" > echo str_replace($replacements, $string); > ?> > > With current behaviour one has to do: > > <?php > $string = 'foo bar'; > $replacements = array( > 'foo' => 'FOO', > 'bar' => 'BAR'); > // Prints "FOO BAR" > echo str_replace(array_keys($replacements), array_values($string)); > ?> >
-1 uless multibyte char keys are handled well. Currently, multibyte char does not work well as hash key. Fixing this is not simpile. -- Yasuo Ohgaki -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php