<?php $map = [ 'foo' => 'bar', 'foobar' => 'foo', ]; $input = 'foobar and foo'; echo str_replace(array_keys($map), array_values($map), $input); // Output: "bar bar and bar" echo strtr($input, $map); // Output: "baz and bar"
You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).