Skip to content

Instantly share code, notes, and snippets.

@rafpro
Forked from justinkelly/base64_url.php
Last active August 29, 2015 14:08
Show Gist options
  • Save rafpro/d849385792cd3315276a to your computer and use it in GitHub Desktop.
Save rafpro/d849385792cd3315276a to your computer and use it in GitHub Desktop.
<?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