I am stuck with a huge problem. I have a dynamic array that may contain anything between 0 and N values (for simplicity of the question, assume they are all boolean e.g. 0 or 1). Of course, once an array is defined/read, the number of values is not unknown anymore. And, I can exclude two trivial cases easily at the start: 0 (empty) and single value array.
What is left is the case of 2+ values inside an array and a need to perform logical AND operation on all of them.
$array = array ( $a, $b, $c, . . . $n ); $logical_function = $a && $b && $c && ... && $n;
Is this even possible to do somehow in PHP? I know how to generate dynamic / variable variables names from an array, but how do I write the AND part function?