how to check values present in 1 array is present in another array or not in php code example
Example 1: check if array value exists in another array php
$result = !empty(array_intersect($people, $criminals));
Example 2: check if any values are the same in an array php
if(count(array_unique($array, SORT_REGULAR)) < count($array)) {
// $array has duplicates
} else {
// $array does not have duplicates
}