Encoding and Decoding Algorithm in PHP
  • There are multiple Encoding and Decoding algorithm in php but most common are there


    Encoding and decoding with str_rot13()


    <?php // str_rot13() example
    $string = 'Encoding and Decoding Encrypted PHP Code';
    $encoded = str_rot13($string);
    $decoded = str_rot13(str_rot13($string));
    echo $encoded ."\n";
    echo $decoded;
    ?>


    Encode and decode with base64_encode() & base64_decode()


    <?php // base64_encode()/base64_decode() example
    $string = 'Encoding and Decoding Encrypted PHP Code';
    $encoded = base64_decode($string);
    $decoded = base64_decode(base64_encode($string));
    echo $encoded ."\n";
    echo $decoded;
    ?>


    Deflate and inflate with gzdeflate() & gzinflate()


    <?php // gzinflate()/gzdeflate() example
    $string = 'Encoding and Decoding Encrypted PHP Code';
    $compressed = gzdeflate($string);
    $uncompressed = gzinflate($compressed);
    echo $compressed ."\n";
    echo $uncompressed;
    ?>


    for further details and related topics http://www.codecorner.somee.com/

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week