Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php function atbashCipher($input) { $atbashMap = [ '0' => '10', '1' => '9', '2' => '8', '3' => '7', '4' => '6', '5' => '5', '6' => '4', '7' => '3', '8' => '2', '9' => '1', ]; $output = ''; for ($i = 0; $i < strlen($input); $i++) { $char = $input[$i]; if (isset($atbashMap[$char])) { $output .= $atbashMap[$char]; } else { $output .= $char; } } return $output; } $input = "01234567890"; echo atbashCipher($input); ?>
Copy Clear