Is it possible to compare to multiple values in a single boolean statement?
For example, I have a CSV file which contains about 60 lines of information. I have read the file and saved the information into a multi dimensional array which is accessible as $arr_info[$row][$cell]. Now I want to access just rows 0,2,46-56.
I was trying to do it in a loop (this is contained in a while loop with a counter $cnt):
Code:
if($cnt == (0 | 2 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54)) {
echo $arr_info[$cnt][1]."<br>";
}
I know that the information is in the array because I can echo the whole array without a problem.. However, I'm trying to have just one boolean operator statement (if) that covers all values considering the code that is being executed is the same.
My code isn't working... Can anyone help out!
|