Skip to content

Instantly share code, notes, and snippets.

@justinkelly
Created September 15, 2011 13:48
Embed
What would you like to do?
simple base64 encode/decode url safe functions
<?php
function base64_url_encode($input)
{
return strtr(base64_encode($input), '+/=', '-_,');
}
function base64_url_decode($input)
{
return base64_decode(strtr($input, '-_,', '+/='));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment