How to use an associative array with PHP’s str_replace function
If you are a PHP developer, I’m sure you know the str_replace function for replacing strings and are probably aware that you can pass an array of strings as the search strings and an array as the replacements. What this post looks at is a way of using a single associative array instead of two arrays, which makes dealing with a large number of replacements much more maintainable in your code.