How to block ip adresses from FILE list like "banned.txt" ... [block or perform action like echo etc..] It will help me very much example of "example-list.txt"
if (in_array($_SERVER['REMOTE_ADDR'], array_map('trim', file('banned.txt')))) { exit('Sorry, your IP address has been banned from this site.'); } PHP: banned.txt should contain one IP in each line.