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