Untitled

mail@pastecode.io avatar
unknown
php
2 years ago
389 B
21
Indexable
Never
<?php
$password = "abAB";
$dictionary = array("a" => "l", "b" => "v", "A" => "L", "B" => "V");
$encoded_password = "";

for($i=0; $i<strlen($password); $i++){
	$old_char = substr($password, $i, 1);
    $new_char = $dictionary[$old_char];
    $encoded_password = $encoded_password . $new_char;
}
echo $password . " will be encoded in " . $encoded_password;
$password = $encoded_password;
?>