fork download
  1. <?php
  2.  
  3. $str = '%2Ftest?a=b&c=d';
  4.  
  5. var_dump(strtr($str, [
  6. "&" => "%26",
  7. "%2F" => "/"
  8. ]));
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
string(13) "/test?a=b&c=d"
string(13) "/test?a=b&c=d"
string(25) "%252Ftest%3Fa%3Db%26c%3Dd"
string(15) "/test?a=b%26c=d"