Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Decode a string with URL-safe Base64.
- *
- * @param string $input A Base64 encoded string
- *
- * @return string A decoded string
- */
- public static function urlsafeB64Decode( $input ) {
- $remainder = strlen( $input ) % 4;
- if ( $remainder ) {
- $padlen = 4 - $remainder;
- $input .= str_repeat( '=', $padlen );
- }
- return base64_decode( strtr( $input, '-_', '+/' ) );
- }
- ?>
Add Comment
Please, Sign In to add comment