Return to Snippet

Revision: 62367
at February 19, 2013 21:12 by apphp-snippets

Initial Code
function base64url_encode
    $base64 = base64_encode
    $base64url = strtr($base64, '+/=', '-_,');
    return $base64url;
function base64url_decode
    $base64url = strtr($text, '-_,', '+/=');
    $base64 = base64_decode
    return $base64;

Initial URL

Initial Description
Encodes the given data with MIME base64. Base64-encoded data takes about 33% more space than the original data.

Initial Title
Base64 Encode and Decode String in PHP

Initial Tags

Initial Language