//bool in_array ( mixed needle, array haystack [, bool strict] ) <? $needle = "Sam"; $haystack = array("Johnny", "Timmy", "Bobby", "Sam", "Tammy", "Joe"); if (in_array($needle, $haystack)) { print "$needle is in the array!\n"; } else { print "$needle is not in the array\n"; } ?>