How do I add case insensitive feature to the preg_replace function. I read that it is "/i" but exactly where do I add it?
$main = "/\\b".$row['main']."\\b/";
$linkedarticle = preg_replace($main, $keyword, $article, 1);
$main = "/\\b".$row['main']."\\b/i";
See also: http://php.net/regexp.reference.delimiters (:
Additionally, preg_quote may come in handy as you're dynamically building your pattern.
Haha perfect, thanks!