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 meant as 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:

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 = Sat, 22 Nov 14 16:52:46 -0800;

str_rot13 encode/decode

base64_encode/base64_decode

gzinflate/gzdeflate


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