PHP code example of jamalo / php-ip-quality-score

1. Go to this page and download the library: Download jamalo/php-ip-quality-score 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/ */

    

jamalo / php-ip-quality-score example snippets


$key = '--api--key--';
$qualityScore = new IPQualityScore($key);
$result = $qualityScore->emailVerification->getResponse('[email protected]');

if ($result->isSuccess() && $result->isValid() && $result->getDeliverability() === 'high') {
    // do something...
} else {
    //show alert tot user
}

$key = '--api--key--';
$qualityScore = new IPQualityScore($key);
$result = $qualityScore->phoneVerification->getResponse('18001234567');

if ($result->isSuccess() && $result->isValid() && !$result->isRisky() && !$result->isVoip() && !$result->isRecentAbuse()) {
    // do something...
} else {
    //show alert tot user
}

$key = '--api--key--';
$qualityScore = new IPQualityScore($key);
$result = $qualityScore->IPAddressVerification
    ->setUserLanguage($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '')
    ->setUserAgent($_SERVER['HTTP_USER_AGENT'] ?? '')
    ->getResponse($_SERVER['REMOTE_ADDR']);

if ($result->isSuccess() && ($result->isTor() || $result->isProxy())) {
    // block tor network request or send to /blocked page..
}

if ($result->isSuccess() && ($result->isProxy() || $result->isVpn())) {
    // block proxy/vpn request or send to /blocked page..
}