1. Go to this page and download the library: Download xsist10/haveibeenpwned 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/ */
xsist10 / haveibeenpwned example snippets
use xsist10\HaveIBeenPwned\HaveIBeenPwned;
use xsist10\HaveIBeenPwned\Adapter\Curl;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$log = new Logger('name');
// Push all logging up to the level of DEBUG to our log file
$log->pushHandler(new StreamHandler('[full log filename]', Logger::DEBUG));
$adapter = new Curl();
$adapter->setLogger($log);
$manager = new HaveIBeenPwned($adapter);
// Calls made to HaveIBeenPwned will be logged to your log file now