I keep getting an error when using this and I am not sure why. Any help would be amazing. I have Googled it and found examples but I get the error even with other peoples examples.
$statement = $list[$i];
echo $statement;
preg_match("/$statement/i", $q)
I also tried this and neither work:
$statement = '/' . $list[$i] . '/i';
echo $statement;
preg_match($statement, $q)
The error I get is:
Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 0
When I echo out the $statement
I get: "/Who/i"
(without the quotes)