Php Preg_match不区分大小写

Php Preg_match不区分大小写,php,Php,嗨,我想让这个preg_匹配不区分大小写 $mot=/"#".$_POST['nom']."#"; if (preg_match($mot,$line)){ $existe=true;break 1;} 我知道我必须添加/I,但它不起作用 在搜索后添加i $mot="#".$_POST['nom']."#i"; if (preg_match($mot,$line)){ $existe=true;break 1;} 或者,如上所述删除前面的/或将其与之匹配

嗨,我想让这个preg_匹配不区分大小写

$mot=/"#".$_POST['nom']."#";
if (preg_match($mot,$line)){ $existe=true;break 1;}

我知道我必须添加/I,但它不起作用

在搜索后添加
i

$mot="#".$_POST['nom']."#i";
if (preg_match($mot,$line)){ $existe=true;break 1;}

或者,如上所述删除前面的/或将其与之匹配