<?PHP
$bannedIPs = array('127.0.0.1','72.189.218.85');
function ipban() {
if (in_array($_SERVER['REMOTE_ADDR'], $bannedIPs)) {
echo 'test';
}
}
ipban();
?>
The output of this script is:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\webserver\htdocs\test\array.php on line 93
Can someone tell me why? I don't get it
And yes $_SERVER['REMOTE_ADDR'] is displaying 127.0.0.1
UPDATE As suggested I tried this now but still get the same error
function ipban() {
$bannedIPs = array('127.0.0.1','72.189.218.85');
if (in_array($_SERVER['REMOTE_ADDR'], $bannedIPs)) {
echo 'test';
}
}
ipban();