Is there an inbuilt PHP function to replace multiple values inside a string with an array that dictates exactly what is replaced with what?
For example:
$string = 'blah blarh bleh bleh blarh'; $trans = array("blah" => "blerh", "bleh" => "blerh"); $result = strtr($string,$trans);
You can check the manual for detailed explanation.