PLUGIN
GoodAccess for

PHP

Download PluginDocumentation
Need help? Book your online session
with GoodAccess Guru.

How to whitelist GoodAccess IP in PHP?

Function

function isAllowed($ip){
   $whitelist = array(‘111.111.111.111’, ‘112.112.112.112’);    // If the ip is matched, return true
   if(in_array($ip, $whitelist)) {
       return true;
   }    return false;
}

Usage

if (! isAllowed($_SERVER[‘REMOTE_ADDR’])) {
   exit;
}