PHP code example of neoan3-apps / jwt

1. Go to this page and download the library: Download neoan3-apps/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/ */

    

neoan3-apps / jwt example snippets

 

use Neoan3\Apps\JWT;

$mySecret = '123456';

JWT::expiresAt('+1 hour');

// encode

$token = JWT::encode($mySecret);

// verify & decode

$decoded = JWT::decode($token, $mySecret);

if($decoded['error'] === false){

  print_r($decoded['decoded']);
  
}