PHP code example of nixilla / php-jwt

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

    

nixilla / php-jwt example snippets



 = JWT::encode($token, $key);
$decoded = JWT::decode($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);
json
{
    "ixilla/php-jwt": "dev-master"
    }
}
bash
git clone https://github.com/jwmickey/php-jwt.git && \
cd php-jwt && \
mkdir bin && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin && \
./bin/composer.phar install --dev && \
./bin/phpunit