// Build the Opted-In stuff$ownedarray = explode(",", $owned);$optedarray = explode(",", $opted);$intersect = array_intersect($owned, $opted);if(is_array($intersect) && count($intersect)){ // We have a match!}