Page 1 of 1

Bulk array searching

Posted: Sat May 18, 2013 6:17 pm
by FrederickGeek8
I am trying to create a simple function to validate a query. A query is invalid if in this array, the 3rd to the 10th index are set to N/A. I could is a if statement like this:
[syntax=php]if($array[3] === 'N/A' && $array[4] === 'N/A', etc...)[/syntax]
is there any better way to "bulk" search an array? Maybe something where I could give it a range or something.

Thanks,
Fred

EDIT: I was able to do it using:
[syntax=php]if(array_keys($array, "N/A") === range(3, 10))[/syntax]