matching complete string with a list

From: paul (paul_at_not.net)
Date: 11/29/04


Date: Mon, 29 Nov 2004 09:26:14 -0800

Dumb question if I knew anything about regular expressions but...

The following works but also catches partial matches such as 'bin-test'
if (!(ereg('not_public|bin', $value))){

The following does not error but does not work
if ($value != 'not_public' or $value != 'bin'){

This works, obviously
if ($value != 'not_public'){

Surely I don't need a bunch of nested if != statements? I'm sure there
is an easy answer to exact matching a $value to a list but I can't
figure it out.

Thanks.