You could create an array of int, and use a search on it:
PHP Code:
int[] iaCheck = new int[]{7, 14, 21, 27, 33, 38, 43, 47);
if (Arrays.binarySearch(iaCheck, d) >= 0)
{
// is true.
}
This is similar to PHP:
PHP Code:
$iaCheck = array(7, 14, 21, 27, 33, 38, 43, 47);
if (array_search($d, $iaCheck) !== false)
{
}