-3

Hi I'm trying to make this preg_match case insensitive

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

I know I have to add /i but it's not working!

Nico
  • 3
  • 4
  • Or this http://stackoverflow.com/questions/10148297/php-preg-match-how-to-match-a-string-upper-lower-case-with-anything-before-o – smiggle Jan 16 '14 at 11:33

1 Answers1

0

Add i after the search

$mot="#".$_POST['nom']."#i";
if (preg_match($mot,$line)){ $existe=true;break 1;}
AO_
  • 2,573
  • 3
  • 30
  • 31