I get the following warning message:
Code: Select all
PHP Warning: preg_match(): Compilation failed: missing ) at offset 28 in file on line 35
And what I can do to solve it?
Thanks
Code: Select all
PHP Warning: preg_match(): Compilation failed: missing ) at offset 28 in file on line 35
Code: Select all
$pattern="/\b".$c_line[1]."\b/i";
if(preg_match($pattern,$text)) $countries[]=$c_line[0];
Code: Select all
$pattern="/\b".preg_quote($c_line[1])."\b/i";
if(preg_match($pattern,$text)) $countries[]=$c_line[0];
Code: Select all
$pattern="/\b".preg_quote($c_line[1])."\b/i";
It should escape any 'bad' character.$pattern="/\b".preg_quote($c_line[1],'/')."\b/i";