alternatively, if you can use .htaccess files - try something like:
allow from all
deny from 1.2.3.4
deny from 192.168.1.0/24
the first deny is for a specific IP - the second is for a "subnet", so in that case, all the 192.168.1.* addresses get blocked. This works more efficiently than PHP as it doesn't touch the parser - gets blocked before then.
As google is everyone's friend, I'll let you search for a tool which converts human friendly IP ranges into IP/subnet. If you haven't found it by tomorrow when I get to work I'll post it then (as I cant remember now and I need sleep... MAJOR PINK EYE!!)
[center]