PHP code example of wepesi / jwt

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

    

wepesi / jwt example snippets


    $data=[
        "data"=>"hello Github",
        "expired"=>300
    ];
    $tken= new JWT;
    $_token=$tken->generate($data)
    echo $_token;

    $tken = new JWT();
    $token = "4edc3e02a3ccf20c213131efa271b79b.vJjR1CIHHdfiCj4Tt+weTtnAZ7PVQw7e1eeQtdT3/qWY43pZH91r9mO92UhXrJB2NGoSv10j.c2f8ab9f30e19e14d47a6491ca77fe36";

    $dec = $tken->decode($token);
    var_dump($dec);