PHP code example of imemento / jwt

1. Go to this page and download the library: Download imemento/jwt library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

imemento / jwt example snippets


use iMemento\JWT\JWT;

/**
 * $payload object/array
 * $privateKey mixed the key used to sign the token
 */
$token = JWT::encode($payload, $private_key);

	$jwt = new JWT($token);
	

	$issuer = $jwt->getIssuer();
	

	$payload = $jwt->decode($public_key);