i'm trying to change the preg_match check from url checking and i'm getting this error
Blockquote preg_match_all(): Compilation failed: nothing to repeat at offset 22
this is the code:
preg_match_all('#\b(' . $allWordsFromProduct . ')\b#ui', $name, $matches);
May $allWordsFromProduct
contains special regex character. You can try:
$allWordsFromProduct = preg_quote($allWordsFromProduct , '#');
preg_match_all('#\b(' . $allWordsFromProduct . ')\b#ui', $name, $matches);
This will escape them.