- in_array: documentation ( source)
<?php
$eligible_categories = array("mens");
$list_categories = array("mens:apparel:shirts", "mens:footwear");
foreach ($eligible_categories as $category)
{
if(in_array($category, $list_categories)){
echo "eligible";
}
}