function clean_up_IPs($filename) { $fh=fopen($filename,r); $backtofile = array(); $curtime = time(); while (!feof($fh)) { $IP=fgets($fh); $IP=rtrim($IP,"\n"); $time=fgets($fh); $time=rtrim($time,"\n"); if ($time > $curtime-(24*3600)) { array_push($backtofile, $IP."\n".$time); } } fclose($fh); $fh = fopen($filename,w); $tofile = implode("\n", $backtofile); fwrite($fh, $tofile); } function find_IP ($filename, $incoming_IP) { $fp = fopen($filename, r); if (filesize($filename) ==0) { return false; } else { $theIPs = fread($fp, filesize($filename)); // print "the IPs: $theIPs
"; $IP_match = strpos($theIPs, $incoming_IP); // print "ip match: $IP_match
"; return $IP_match; fclose($fp); } }

I Pick My Nose

I pick my nose... do you?

see results

 

 

 

 

 

 

blog.ipickmynose.com