我正在尝试编写一个条件,检查$variable
是否等于以下字符串中的任何值
$category_id = "348,349,398,399,400,402,404,406,410,415,417,419,421,423,425,434,436,438,439,442,350,444,446,448,450,458,460,461,464,468,470,475,479,480,481,483,485,487,489,491,492,498,499,501,503,506,352,509,511,513,521,523,533,535,538"
非常感谢任何帮助。
答案 0 :(得分:0)
if(in_array($searchValue,explode(",",$category_id)))
{
// in there
}
<强> Fiddle 强>