Skip to content

Commit 79a3892

Browse files
authored
Create decode-json-pure.php
1 parent fd6c1f6 commit 79a3892

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

decode-json-pure.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
// https://github.com/BaseMax/php-jwt-example
3+
require 'vendor/autoload.php';
4+
use \Firebase\JWT\JWT;
5+
use \Firebase\JWT\SignatureInvalidException;
6+
$key = '83aeee518617ad6f3393bf0685e37d3e';
7+
8+
// JSON
9+
$token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YTEiOiJ0ZXN0MSIsImRhdGEyIjoidGVzdDIiLCJkYXRhMyI6InRlc3QzIiwiZGF0YTQiOiJ0ZXN0NCIsImRhdGE1IjoidGVzdDUifQ.nOa6tq6bDCiURP2GpTehux3geHiNiqQKJXaZ0M_uJ0WD0yTmKM66LS23fCAMraem58HWnmlX4V4WB7-eTfFpbQ';
10+
$decode = JWT::decode($token, $key, array('HS512'));
11+
print_r($decode);
12+
print "\n";

0 commit comments

Comments
 (0)