1. Go to this page and download the library: Download elliotjreed/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/ */
elliotjreed / haveibeenpwned example snippets
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$count = (new \ElliotJReed\HaveIBeenPwned\BreachedAccount($guzzle, $apiKey))->count('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breaches = (new \ElliotJReed\HaveIBeenPwned\BreachedAccount($guzzle, $apiKey))->breaches('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breachNames = (new \ElliotJReed\HaveIBeenPwned\BreachedAccount($guzzle, $apiKey))->breachNames('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$isBreached = (new \ElliotJReed\HaveIBeenPwned\BreachedAccount($guzzle, $apiKey))->isBreached('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breachNames = (new \ElliotJReed\HaveIBeenPwned\BreachedAccount($guzzle, $apiKey))->breachNamesByHashRange('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$count = (new \ElliotJReed\HaveIBeenPwned\Password($guzzle, $apiKey))->count('password123');
$count = (new \ElliotJReed\HaveIBeenPwned\Password($guzzle, $apiKey))->count('password123', ntlm: true, addPadding: true);
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$isPwned = (new \ElliotJReed\HaveIBeenPwned\Password($guzzle, $apiKey))->isPwned('password123');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$pastes = (new \ElliotJReed\HaveIBeenPwned\PastedAccount($guzzle, $apiKey))->pastes('[email protected]');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$allBreaches = (new \ElliotJReed\HaveIBeenPwned\Breaches($guzzle, $apiKey))->allSources();
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$latestBreach = (new \ElliotJReed\HaveIBeenPwned\Breaches($guzzle, $apiKey))->latest();
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breachesBySource = (new \ElliotJReed\HaveIBeenPwned\Breaches($guzzle, $apiKey))->bySourceName('Adobe');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breachesBySource = (new \ElliotJReed\HaveIBeenPwned\Breaches($guzzle, $apiKey))->byDomain('adobe.com');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$haveIBeenPwnedDataClasses = (new \ElliotJReed\HaveIBeenPwned\DataClasses($guzzle, $apiKey))->all();
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$breachedAddresses = (new \ElliotJReed\HaveIBeenPwned\BreachedDomain($guzzle, $apiKey))->search('example.com');
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$subscribedDomains = (new \ElliotJReed\HaveIBeenPwned\SubscribedDomains($guzzle, $apiKey))->all();
$guzzle = new \GuzzleHttp\Client();
$apiKey = 'HIBP-API-KEY';
$domainVerification = new \ElliotJReed\HaveIBeenPwned\DomainVerification($guzzle, $apiKey);
$txtRecordValue = $domainVerification->generateDnsToken('example.com');
$failureReason = $domainVerification->verifyDnsToken('example.com');
$domainVerification->sendEmail('example.com', 'admin');