Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*$string ="a.p.r.i.c.o.t";
- foreach($array as $lettre)
- {
- if ($lettre == "a"){
- echo "e";
- }
- if ($lettre == "b"){
- echo "p";
- }
- if ($lettre == "c"){
- echo "s";
- }
- if ($lettre == "d"){
- echo "m";
- }
- if ($lettre == "e"){
- echo "i";
- }
- if ($lettre == "f"){
- echo "w";
- }
- if ($lettre == "g"){
- echo "k";
- }
- if ($lettre == "h"){
- echo "n";
- }
- if ($lettre == "i"){
- echo "u";
- }
- if ($lettre == "j"){
- echo "v";
- }
- if ($lettre == "k"){
- echo "g";
- }
- if ($lettre == "l"){
- echo "c";
- }
- if ($lettre == "m"){
- echo "l";
- }
- if ($lettre == "n"){
- echo "r";
- }
- if ($lettre == "p"){
- echo "b";
- }
- if ($lettre == "q"){
- echo "x";
- }
- if ($lettre == "r"){
- echo "h";
- }
- if ($lettre == "s"){
- echo "m";
- }
- if ($lettre == "t"){
- echo "d";
- }
- if ($lettre == "u"){
- echo "o";
- }
- if ($lettre == "v"){
- echo "f";
- }
- if ($lettre == "w"){
- echo "z";
- }
- if ($lettre == "x"){
- echo "q";
- }
- if ($lettre == "y"){
- echo "a";
- }
- if ($lettre == "z"){
- echo "j";
- }
- }*/
- function translator($string){
- $translate = array(
- 'a' => 'y', 'b'=>'p','c'=>'l','p'=>'s', 'r' => 'n', 'i' =>'e','o'=> 'u', 't' => 'd'
- );
- $change = explode(".", $string);
- foreach ($change as $key => $value) {
- $change[$key]= $translate[$value];
- }
- return implode(".",$change);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement