I was wondering if someone could give some tips as to how improve long strings of if-else statements and redundant if statements. For example, how should I optimize this if statement so it would be more re-usable for maintenance purposes:
if (($game == 'DS' && $eventId == 185) || ($game == 'MT' && $eventId == 333) || ($game == 'HK' && $eventId == 51) || ($game == 'main' && $eventId == 1166) ||
($game == 'WT' && $eventId == 97)) {
/* some code */
}
$game
and$eventId
variables together as array members and then do aif (in_array($game.$eventId, $matches)) blah...
. \$\endgroup\$