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

$ip = $_SERVER['REMOTE_ADDR'];

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