Guest User

Untitled

a guest
Nov 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. /**
  3. * Decode a string with URL-safe Base64.
  4. *
  5. * @param string $input A Base64 encoded string
  6. *
  7. * @return string A decoded string
  8. */
  9. public static function urlsafeB64Decode( $input ) {
  10. $remainder = strlen( $input ) % 4;
  11. if ( $remainder ) {
  12. $padlen = 4 - $remainder;
  13. $input .= str_repeat( '=', $padlen );
  14. }
  15.  
  16. return base64_decode( strtr( $input, '-_', '+/' ) );
  17. }
  18. ?>
Add Comment
Please, Sign In to add comment