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?
Code:$main[] = "/\b".$row['main']."\b/"; $linkedarticle = preg_replace($main, $keyword, $article, 1);
| SitePoint Sponsor |


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?
Code:$main[] = "/\b".$row['main']."\b/"; $linkedarticle = preg_replace($main, $keyword, $article, 1);
Code:$main[] = "/\b".$row['main']."\b/i";![]()
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
Additionally, preg_quote may come in handy as you're dynamically building your pattern.
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks