$found = false; $one = strpos($date, $search); $two = strpos($from, $search); $three = strpos($subj, $search); $four = strpos($message, $search); if ( !($one || $two || $three || $four) ) $found = true; if ($found) echo $tabled;