fork(3) download
  1. <?php
  2. $arrFrom = array("1","2","3","B");
  3. $arrTo = array("A","B","C","D");
  4. $word = "ZBB2";
  5. echo str_replace($arrFrom, $arrTo, $word) . "\n";
  6.  
  7. $arr = array("1" => "A","2" => "B","3" => "C","B" => "D");
  8. $word = "ZBB2";
  9. echo strtr($word,$arr);
  10. ?>
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
ZDDD
ZDDB