5){ $files = file($file_name);// get file lines as array // set new array of bot file lines after checking timestamp $new_file = array(); //set array of bots fo8und $all = array(); foreach ($files as $line) {// read each line and explode delimiter $parts = explode("##", $line); //parts[0] is time stamp //if time stamp is greater than current timestamp minus one day if($parts[0] >= $bot_time - 86400) { $all[] = $parts[1];// parts[1] bots name to array // now while still in loop comparing time delete lines greater than 1 day old by not putting back into file //minutes 86400 24hrs Bots on line today $new_file[] = $line; //put lines back into file that are still within the 24 hour period } }// end loop // write updated bots back to file. can be an array as is here file_put_contents($file_name, $new_file, LOCK_EX); // now array unique out duplicate bot names $arraybots = array_unique($all); //now implode filtered array back to string $bots = implode(" ", $arraybots); if(empty($bots)){ $bots = " none"; } // display in footer. style as desired echo ''; } ?>