<?php
function check($arr, $ip)
{
  if($arr){
    if((array_search($ip, $arr) !== false)){
      return true;
    }
  }
  return false;
}

$ips1 = file("/var/wwwdata/ips1.txt", FILE_IGNORE_NEW_LINES);
$ips2 = file("/var/wwwdata/ips2.txt", FILE_IGNORE_NEW_LINES);
$ips3 = file("/var/wwwdata/ips3.txt", FILE_IGNORE_NEW_LINES);

$ip = $_SERVER['REMOTE_ADDR'];

if(check($ips1, $ip)){
  include "./index1.php";
}
else if(check($ips2, $ip)){
  include "./index2.php";
}
else if(check($ips3, $ip)){
  include "./index3.php";
}
else{
  include "./index0.php";
}
?>
