Dont wanna be annoying but your php code is a bit inefficient and you cant ban more the 6 ips easily.
My idea:
<?php
$ips = array('0.0.0.0',
'add ips here');
if(in_array($_SERVER['REMOTE_ADDR'],$ips))
{
echo "You have been banned from this website. To appeal this ban, contact...