Well, I can't understand what is the purpose of str_rot13 php function. I understand how it works but can't figure out in which situations is suitable for use. Can you give me some examples?
str_rot13(string $string ): string. Performs the ROT13 encoding on the string argument and returns the resulting string. The ROT13 encoding simply shifts every letter by 13 places in the alphabet while leaving non-alpha characters untouched.
Definition and Usage The str_rot13() function performs the ROT13 encoding on a string. The ROT13 encoding shifts every letter 13 places in the alphabet. Numeric and non-alphabetical characters remains untouched.
In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques. -Wikipedia
There is nothing more to it, it's easy to implement and having it in the library wouldn't do harm. It can be used for spoilers (instead of a "show spoiler" button), for trivial encryption (a client-side config file, a hint in an online game), as fancy way to encode your email (avoid spam bots) or just for toying around. However, serious use is highly discouraged (unless you plan on bombing something).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With