I want to replace different sub-strings with multiple different strings in a string, is there a nicer way to do rather than i do labor work and use
str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
as many times as the number of strings to be replaced?
for example: replace a, b and c with d, e and f respectively in any sample string.
Of course i have a large number of words to change for this i need it.
str_replace() accepts an array for both search and replace parameters, so you can pass several strings in array to search and will be replaced by the corresponding strings in the array passed in replace parameter, like so: