Sprawdź, czy wszystkie wartości w tablicy są równe PHP
if(count(array_unique($array)) === 1) {
// all values in $array are the same
} else {
// at least 1 value in $array is different
}
if(count(array_unique($array)) === 1) {
// all values in $array are the same
} else {
// at least 1 value in $array is different
}
$a=["a","b","c","d","e"];
$b=["d","e","f","g"];
$inBothAndB = array_intersect($a, $b); // Array([3] => d [4] => e)
$allvalues = array('true', 'true', 'true');
if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') {
}