I have two arrays; let's call one the "complete list" and the other "users selected". I need to take the "complete list" array and see if any of the values from the "users selected" array exist in the "complete list" array. If any one value does exist, then it should return true. I have tried using the "in_array" function and included both arrays, but it appears the in_array must have all items in the "needle" array matching, otherwise it doesn't consider it a match. Could someone help me figure out the best way to compare the two arrays and if any single value exists, then return true?
$complete_list = array(
"item1",
"item2",
"item3",
"item4",
"item5",
);
$users_selected = array(
"item3",
"item5",
"non-existent-item",
);
Thank you in advance.