When you need to check/have combinations of array elements, how can you avoid nesting foreach?
Example code:
$as = array($optionA1, $optionA2)
$bs = array($optionB1, $optionB2)
$cs = array($optionC1, $optionC2)
foreach ($as as $a) {
foreach ($bs as $b) {
foreach ($cs as $c) {
$result = $this->method($a, $b, $c);
if ($result) etc
}
}
}
Anyone with alternative approaches that can avoid nesting?