Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2. /*$string ="a.p.r.i.c.o.t";
  3. foreach($array as $lettre)
  4. {
  5. if ($lettre == "a"){
  6. echo "e";
  7. }
  8. if ($lettre == "b"){
  9. echo "p";
  10. }
  11. if ($lettre == "c"){
  12. echo "s";
  13. }
  14. if ($lettre == "d"){
  15. echo "m";
  16. }
  17. if ($lettre == "e"){
  18. echo "i";
  19. }
  20. if ($lettre == "f"){
  21. echo "w";
  22. }
  23. if ($lettre == "g"){
  24. echo "k";
  25. }
  26. if ($lettre == "h"){
  27. echo "n";
  28. }
  29. if ($lettre == "i"){
  30. echo "u";
  31. }
  32. if ($lettre == "j"){
  33. echo "v";
  34. }
  35. if ($lettre == "k"){
  36. echo "g";
  37. }
  38. if ($lettre == "l"){
  39. echo "c";
  40. }
  41. if ($lettre == "m"){
  42. echo "l";
  43. }
  44. if ($lettre == "n"){
  45. echo "r";
  46. }
  47. if ($lettre == "p"){
  48. echo "b";
  49. }
  50. if ($lettre == "q"){
  51. echo "x";
  52. }
  53. if ($lettre == "r"){
  54. echo "h";
  55. }
  56. if ($lettre == "s"){
  57. echo "m";
  58. }
  59. if ($lettre == "t"){
  60. echo "d";
  61. }
  62. if ($lettre == "u"){
  63. echo "o";
  64. }
  65. if ($lettre == "v"){
  66. echo "f";
  67. }
  68. if ($lettre == "w"){
  69. echo "z";
  70. }
  71. if ($lettre == "x"){
  72. echo "q";
  73. }
  74. if ($lettre == "y"){
  75. echo "a";
  76. }
  77. if ($lettre == "z"){
  78. echo "j";
  79. }
  80. }*/
  81. function translator($string){
  82. $translate = array(
  83. 'a' => 'y', 'b'=>'p','c'=>'l','p'=>'s', 'r' => 'n', 'i' =>'e','o'=> 'u', 't' => 'd'
  84. );
  85.  
  86. $change = explode(".", $string);
  87.  
  88. foreach ($change as $key => $value) {
  89. $change[$key]= $translate[$value];
  90. }
  91. return implode(".",$change);
  92. }
  93. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement