public function testUrlSafeCharacters() { $encoded = JWT::encode('f?', 'a'); $this->assertEquals('f?', JWT::decode($encoded, 'a')); }
<?php require_once './vendor/autoload.php'; use JWT\Authentication\JWT; $key = "example_key"; $token = array("iss" => "http://example.org", "aud" => "http://example.com", "iat" => 1356999524, "nbf" => 1357000000); $jwt = JWT::encode($token, $key); $decoded = JWT::decode($jwt, $key); print_r($decoded);