PHP code example of ziishaned / php-license

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

    

ziishaned / php-license example snippets




use Ziishaned\PhpLicense\PhpLicense;

$data = [
  "firstName" => "John",
  "lastName"  => "Doe",
  "email"     => "[email protected]",
];

$privateKey = file_get_contents('path/to/private_key.pem');
$license    = PhpLicense::generate($data, $privateKey);

var_dump($license);



use Ziishaned\PhpLicense\PhpLicense;

$license = 'agW4Riht6xHEfbpDaZUcTCmZVHgGgCnzXc0+nqLAMjuS6ouuGQVv/JqjAuo89tUgTu3F7Q+WProPcNm1aXdavxj3xOxTJ3e2w0NSS09sBZONxG9MzzofqvYPCnu/I1WMLgaRXiiNJcz5WtqFLFSdTgehqU5VLO+eDhfWUeZ0EJlCtCLPu19hP56/+24+/tmnh4ySLc9tV+YGLYtpmt7Gyf+h3sbMO0SJMwe+XSuuTcUsIUDg3AQUlj7c4ctwhkdYkRyyjj27U09CgpWWgU5b3sXSqZ3DFdTNaP8sIVH3Y39b7/o+Gx7WIHzngCnczK58L81LTVwnkyzSBqKUT5oq4A==';

$publicKey     = file_get_contents('path/to/public_key.pem');
$parsedLicense = PhpLicense::parse($license, $publicKey);

var_dump($parsedLicense);
bash
composer