SyntaxFix
Write A Post
Hire A Developer
Questions
str_replace with arrays just performs all the replacements sequentially. Use strtr instead to do them all at once:
str_replace
strtr
$new_message = strtr($message, 'lmnopq...', 'abcdef...');