PHP code example of ridvanbaluyos / haveibeenpwned

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

    

ridvanbaluyos / haveibeenpwned example snippets



error_reporting(E_ALL);
// namespace and autoloaders
use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;


use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;

$breachedAccount = new BreachedAccount();
$result = $breachedAccount->setAccount('[email protected]')
        ->setIncludeUnverified()
        ->setDomain('tumblr.com')
        ->get();


use \Ridvanbaluyos\Pwned\Breaches as Breaches;

$breachedSites = new Breaches();
$result = $breachedSites->setDomain('adobe.com')->get();


use \Ridvanbaluyos\Pwned\DataClasses as DataClasses;

$dataClasses = new DataClasses();
$result = $dataClasses->get();


use \Ridvanbaluyos\Pwned\PasteAccount as PasteAccount;

$pasteAccount = new PasteAccount();
$result = $pasteAccount->setAccount('[email protected]')->get();


use Ridvanbaluyos\Pwned\PwnedPasswords as PwnedPasswords;

$pwnedPasswords = new PwnedPasswords();
$result = $pwnedPasswords->setPassword('password123')->get();