<?php
    $api = "c0dd567ceaf952f5ee50fc7a0df72e64";
    $phone = $_GET['phone_number'];
    $url = "https://api.theblacklist.click/standard/api/v1/Lookup/key/".$api."/response/json/phone/".$phone;

    $content = file_get_contents($url);

    $_results = json_decode($content,true);

    if (is_null($_results)) {
        //Something went wrong
    }else{
        if( $_results['results'] == 0 ) {
            echo "<div style='background:#a9ffa9; padding:15px;'>This number is Clean on letigator list.</div>";
        } else {
            echo "<div style='background:#ff9e9e; padding:15px;'>This number is on letigator list, Hangup the call.</div>";
        }
    }
?>