This peice of code work for most type of variables. See how it works in inline comment.
$count=0; // variable to count the matched words
foreach ($items as $item)
{
if($item == $somevalue)
{
$count++; // if any item match, count is plus by 1
}
}
if($count == count($items))
{
echo "true"; // if numbers of matched words are equal to the number of items
}
else
{
echo "false";
}
Hope it works , And sorry for any mistake