Bulk array searching
Posted: Sat May 18, 2013 6:17 pm
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:
Thanks,
Fred
EDIT: I was able to do it using:
if($array[3] === 'N/A' && $array[4] === 'N/A', etc...)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:
if(array_keys($array, "N/A") === range(3, 10))