Some content on my website needs to be hidden if the referrer is any of the blacklisted domains. The following seems to be working, but the full list is 12,000+ domains. I’m guessing there is a more efficient method to do this (using php 8). Any thoughts on best way to approach this?
$referrerdomain = $_GET['referrer'];
$cosblacklist = $referrerdomain !== '' && $referrerdomain == "validcodes.net" || $referrerdomain == "coupons4shopping.org" || $referrerdomain == "us.buybuylife.com" || $referrerdomain == "couponsgo.org";
//Show Hide content
if ($cosblacklist){
$showorhidecos = "hideme";
} else {
$showorhidecos = "showme";
}
?>
<div class="<?php echo $showorhidecos; ?>">
<p>Show stuff</p>
</div>