Consider:
preg_match("#(.{100}$keywords.{100})#", strip_tags($description), $matches);
I'm trying to show only 100 characters in each side with the search string in the middle.
This code actually works, but it is a case sensitive. How do I make it case insensitive?
Just add the i modifier after your delimiter #:
i
#
preg_match("#(.{100}$keywords.{100})#i", strip_tags($description), $matches);
If the i modifier is set, letters in the pattern match both upper and lower case letters.
1.4m articles
1.4m replys
5 comments
57.0k users