What would be the best way of writing the below if statement more efficiently?
if (!preg_match('/^[0-9]+$/', $min) || !preg_match('/^[0-9]+$/', $max) || !preg_match('/^[0-9]+$/', $c1) || !preg_match('/^[0-9]+$/', $c2) || !preg_match('/^[0-9]+$/', $c3) || !preg_match('/^[0-9]+$/', $c4) || !preg_match('/^[0-9]+$/', $c5) || ) { echo 'Wrong value" exit; };
Thanks in advance!
Btw I am validating for integers…. whole numbers!
How about:
preg_grep()docs\dsequence instead of a character class.