$reason = null; while ($row = mysql_fetch_array($result)) { if (strpos($text,$row[0]) === false) $blocked = true; $reason = $row[1]; break; } } return ($reason == null ? 'nomatch' ? $reason);