Jump to content

wransik

New Members
  • Posts

    2
  • Joined

  • Last visited

wransik's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you, if( preg_match( "#\b{$ip}\b#", $file ) That did the trick.
  2. I'm trying to create a banlist based on a .txt file which has the IP's stored (one per line). Now I'm comparing the current users IP with the .txt file content like this: $file = file_get_contents( "text_file.txt" ); if( preg_match( "/$ip/", $file ) ) { // block } My problem is that non-exact matches also trigger the block, for example 127.0.0.12 is in the .txt, my IP is 127.0.0.1 and I'm getting blocked. How can I make it an exact match only ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.