I have written a simple search engine, in conjnction with a mysql database, which uses mysql's "LIKE" to locate records. I'd like to embolded the searched for string in the text returned to the user. What is the most efficient way to return the result
"Here is the resultant text with the words cat , cAt and CAT within the text"
when the user types in "cat" ?
I could use multiple passes with str_replace, but how can I cope with any combination of upper/lowercase letters? Regular expressions, if so how please?
best Graham