<?php $a = ['a' => -1, 'b' => 0.5, 'c' =>0.5]; //Combinations $c = [ ['a','b','c'], ['a','b'], ['a','c'], ['b','c'] ]; foreach($c as $v){ $s = array_sum(array_intersect_key($a,array_flip($v))); echo !$s ? (implode(' & ',$v)) : ''; }
You have javascript disabled. You will not be able to edit any code.