check if all values in array are equal php
if(count(array_unique($array)) === 1) {
// all values in $array are the same
} else {
// at least 1 value in $array is different
}
check if all values in array are equal php
if(count(array_unique($array)) === 1) {
// all values in $array are the same
} else {
// at least 1 value in $array is different
}
php check if all values in array are equal
$allvalues = array('true', 'true', 'true');
if (count(array_unique($allvalues)) === 1 && end($allvalues) === 'true') {
}
php get values that exist in both arrays
$a=["a","b","c","d","e"];
$b=["d","e","f","g"];
$inBothAndB = array_intersect($a, $b); // Array([3] => d [4] => e)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us