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));
?>





regards,
Marten.


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to