preg_split is a regex function that splits a string - in your case a comma.

You could substitute regular expressions for the ips and iterate through them using the same loop, but instead of:

if($_SERVER['REMOTE_ADDR'] == $ip) {

replace that if statement with a regex compare.

81.177.x.x would be 81\.177\..*
_________________________
Mark Cushman