When to use strtr vs str_replace?

First difference: An interesting example of a different behaviour between strtr and str_replace is in the comments section of the PHP Manual: <?php $arrFrom = array(“1″,”2″,”3″,”B”); $arrTo = array(“A”,”B”,”C”,”D”); $word = “ZBB2″; echo str_replace($arrFrom, $arrTo, $word); ?> I would expect as result: “ZDDB” However, this return: “ZDDD” (Because B = D according to our array) … Read more