## Make an array of IP address that you want to block.
$blocked_ip = array("192.168.1.20","192.168.1.21");
## This is the IP address from where request came to you
$request_ip = $_SERVER["HTTP_CLIENT_IP"];
## If the requested IP address exist at blocked IP list
## You can stop the script here.
but my suggestion is to redirect to another page instead of die().
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example.com/error.html");