Map letters from one alphabet to another
str_cipher_mono_alphabetic(string $string, string $alpha, string $beta): bool
This function has defined some constants for common alphabets
CIPHER_ALBHED='ypltavkrezgmshubxncdijfqowYPLTAVKREZGMSHUBXNCDIJFQOW';
CIPHER_ENGLISH='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
CIPHER_INVERT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
string
The string to transform
alpha
The alphabet to map from
beta
The alphabet to map to
Returns a new string, where each letter has been mapped to a new alphabet
Example # 1 Example uses of str_cipher_mono_alphabetic()
echo str_cipher_mono_alphabetic('abc', 'abc', 'xyz');
The above example will output:
xyz
Example # 2 Using the defined constant to convert to AlBhed
echo str_cipher_mono_alphabetic('What is this?', CIPHER_ENGLISH, CIPHER_ALBHED);
The above example will output:
Fryd ec drec?