I'm currently developing a simple IP ban system that bans an IP if something is done twice. I have searched but it seems that the answers I find are ones that use foreach. What I am wondering, is how to remove a value from an array to tidy it up?
code:
function ipCheck($ip) {
$ip1 = array();
$ip2 = array();
if(in_array($ip, $ip2, true)){
die();
}
elseif(in_array($ip, $ip1){
array_push($ip2, $ip);
else{
array_push($ip1, $ip);
}
}
}