// All values are equal if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') { } // Check the thing you don't want if (in_array('false', $allvalues, true)) { }