From 8a58db901b00ce885eff1b01ab41a323a3fdb18a Mon Sep 17 00:00:00 2001 From: Richard Ocaranza Date: Tue, 8 Aug 2023 20:35:16 -0400 Subject: [PATCH] Reto #1 - php Reto #1 fue resuelto en php. --- .../php/kodenook.php" | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 "Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/kodenook.php" diff --git "a/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/kodenook.php" "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/kodenook.php" new file mode 100644 index 0000000000..4f675669f1 --- /dev/null +++ "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/kodenook.php" @@ -0,0 +1,66 @@ + '4', + 'b' => 'I3', + 'c' => '[', + 'd' => ')', + 'e' => '3', + 'f' => '|=', + 'g' => '&', + 'h' => '#', + 'i' => '1', + 'j' => ',_|', + 'k' => '>|', + 'l' => '1', + 'm' => '/\/\\', + 'n' => '^/', + 'o' => '0', + 'p' => '|*', + 'q' => '(_,)', + 'r' => 'I2', + 's' => '5', + 't' => '7', + 'u' => '(_)', + 'v' => '\/', + 'w' => '\/\/', + 'x' => '><', + 'y' => 'j', + 'z' => '2', + '1' => 'l', + '2' => 'r', + '3' => 'e', + '4' => 'a', + '5' => 's', + '6' => 'b', + '7' => 't', + '8' => 'b', + '9' => 'g', + '0' => 'o' + ]; + $result = ''; + foreach (str_split((string)$txt) as $letter) { + $result .= $vocabulary[$letter]; + } + + return $result . PHP_EOL; +} + +/* The line `echo leet('hola leet');` is calling the `leet` function and passing the string `'hola +leet'` as an argument. The function will convert the input text to leet (1337) speak and return the +result. The `echo` statement then outputs the result to the console. */ +echo leet('hola leet');