This is a library for easily reading and understanding SSL certificates using PHP.
composer require punkstar/ssl
<?php
require_once __DIR__.'/vendor/autoload.php';
use Punkstar\Ssl\Reader;
$reader = new Reader();
$certificate = $reader->readFromUrl("https://github.com");
printf("Name: %s\n", $certificate->certName());
printf("Valid To: %s\n", $certificate->validTo()->format('r'));
printf("Valid From: %s\n", $certificate->validFrom()->format('r'));