Skip to content

Instantly share code, notes, and snippets.

@tva77
Created November 21, 2024 11:15
Show Gist options
  • Save tva77/c1e65ffc145f8fafa9024b11cc66f83a to your computer and use it in GitHub Desktop.
Save tva77/c1e65ffc145f8fafa9024b11cc66f83a to your computer and use it in GitHub Desktop.
how to decode jwt token in php in 1 line
<?php
print_r(json_decode(base64_decode(str_replace('_', '/', str_replace('-','+',explode('.', $token)[1])))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment