我正在尝试匹配项目列表中的n个元素:
(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety|hundred|thousands|million|billion){6}
我想检查上面列表中有多少项存在于字符串中。怎么能实现呢?
例如,我想检查字符串是否包含列表中的任何6:
$item[] = array(
'meal_type' => $meal_type,
'meal_package' => $meal_package,
'meal_time' => $meal_time,
'meal_plan_days' => $meal_plan_days,
'meal_dish_type' => $meal_dish_type,
'prefixed_qty' => $prefixed_qty,
'prefixed_date' => $prefixed_date,
'cart_plan' => $cart_total,
'product_rule' => $product_rule
);
$_SESSION['shopping_cart']['item'] = array_merge($_SESSION['shopping_cart']['item'], $item);