How to optimize the IF condition with many conditions and same output [closed]
Sure You could use in_array for this type of check, something like this if (in_array($string, [‘apple’, ‘banana’, ‘kiwi’])) { // keep adding as many as you need $Detail = false; $bShowNew = true; } If your array gets to big you can create a variable that will contain that array $allowed = [ ‘apple’, ‘banana’, … Read more