Checking if ANY of an array’s elements are in another array

You can use array_intersect().

$peopleContainsCriminal = !empty(array_intersect($people, $criminals));

Leave a Comment