Sorry I'm a newbie, but I'm trying to use the script I found here:
Only allow users on page if IP address is approved
$allowedIps = ['x.x.x.x', 'x.x.x.x'];
$userIp = $_SERVER['REMOTE_ADDR'];
if (!in_array($userIp, $allowedIps)) {
exit('Unauthorized');
}
But instead, I want to load thousands of ip ranges from a .txt file
like this: (I don't know correct function)
$allowedIps = ['www.example.com/ip_list.txt'];
ip_list.txt list:
xx.xxx.xxx.xx/30
xx.xxx.xxx.xx/78
xx.xxx.xxx.xx/59