Wow! JWT for PHP. Fast Javascript Web Token library for PHP.
PHP 5.3+
include __DIR__.'/src/Wow/Util/WowJwt.php';
use Wow\Util\WowJwt as JWT;
$payload = '{"iss":"ant"}';
$key = '1234567890';
$algo = 'HS256';
$verify = true;
$encrypt = false;
$t = JWT::encode($payload, $key, $algo, $encrypt);
echo $t."\n";
$t = JWT::decode($t, $key, $verify, $encrypt);
echo $t."\n";
{
"require": {
"yftzeng/wow-jwt": "dev-master"
}
}
$ php composer.phar update
include 'vendor/autoload.php';
use Wow\Util\WowJwt as JWT;
$payload = '{"iss":"ant"}';
$key = '1234567890';
$algo = 'HS256';
$verify = true;
$encrypt = false;
$t = JWT::encode($payload, $key, $algo, $encrypt);
echo $t."\n";
$t = JWT::decode($t, $key, $verify, $encrypt);
echo $t."\n";
the MIT License