Skip to content

Latest commit

 

History

History
59 lines (37 loc) · 1.02 KB

str_cipher_mono_alphabetic.md

File metadata and controls

59 lines (37 loc) · 1.02 KB

Description

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';

Parameters

string

The string to transform

alpha

The alphabet to map from

beta

The alphabet to map to

Returns

Returns a new string, where each letter has been mapped to a new alphabet

Examples

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?