Re: Re: Matching *exact* string?

From: Date: Sun, 31 Oct 2004 11:58:04 +0000
Subject: Re: Re: Matching *exact* string?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-200766@lists.php.net to get a copy of this message
* and then Daniel Schierbeck declared.... > I'd rather go with something like this: > > $banned_ips = array('123.123.123.123', '321.321.321.321'); // Banned IPs > > if (in_array($_SERVER['REMOTE_ADDR'], $banned_ips)) { > die('Dude, you\'re banned!'); > } > > But if I were you I'd choose something more advanced. I think in_array() sounds like a great solution, wonder if it's faster than comparing each ooe with == ? thanks! -- Nick W

« previous php.general (#200766) next »