fork download
  1. <?php
  2. function encriptar($var)
  3. {
  4. $search = array('E', 'D', 'C', 'B', 'A');
  5. $replace = array('A1B', 'E', 'D', 'C', 'B');
  6.  
  7. $pos = array_search($var, $search);
  8. if ($pos !== FALSE)
  9. $b = str_replace($search[$pos], $replace[$pos], $var);
  10.  
  11. echo $b;
  12. }
  13.  
  14. encriptar('E');
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
A1B