Examples of Encoding & Decoding Encrypted PHP

This is a concise summary of the article Encoding and Decoding Encrypted PHP Code, which explains further the encoding/decoding examples presented here. These examples are a quick reference for those familar with PHP.

Example using a string of text

$string = 'Encoding and Decoding Encrypted PHP Code';

str_rot13 encode/decode

base64_encode/base64_decode

gzinflate/gzdeflate

Combined encoding: gzinflate(str_rot13(base64_decode()))

Decoding strings that have been encoded with combinations of these functions look like this:

Depending on your experience level, decoding strings of this variety can be tricky. The easiest way to decode such a string is to use any reputable online decoding tool ;)

Example using PHP’s date() function

$date = Thu, 25 Apr 24 05:11:37 +0000;

str_rot13 encode/decode

base64_encode/base64_decode

gzinflate/gzdeflate

For more information, see the original article, Encoding and Decoding Encrypted PHP Code.