<?php

$blacklist = array("123.123.",
        "234.234.234.234",
        "111.111.222");

if(in_array($_SERVER['REMOTE_ADDR'],$blacklist)) {

     // this handles exact matches

     echo '<meta http-equiv="refresh" content="0; URL=http://localhost">' ;
     exit();

} else {

     // this handles wild card matches

      foreach($blacklist as $ip) {
       if(eregi($ip,$_SERVER['REMOTE_ADDR'])) {
    echo '<meta http-equiv="refresh" content="0; URL=http://localhost">' ;
         exit();
        }
      }
}
?>