I am after some advice on the best way to search an array for multiple values sequentially.
My scenario is this:
I have an array with anywhere up to 10 elements. The elements are Wifi Security types such as WPA, WPA2, WEP 64, WEP 128, etc.
What I would like to do is go through the array and select the best available security type according to what is available in the array. The array will differ as I work through different routers, so one router may only support up to WEP 128 while another will have WPA2 available. In my mind, I can see it working in that it will first search the array for WPA2, if it doesnt find it, it will then look for WPA, if thats not found, it will move on to WEP 128, and so on.
I am struggling to think of the best way to handle this. I have a vague idea but I think it will end up being a loooong bit of code with many many if statements and foreach loops.
Any advice would be greatly appreciated and I will happily provide more info if what I have said is not very clear.
Thanks.
In reply to Search an array for values sequentially by Doozer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |