I've made a simple search script which returns matching rows from the database where the content contains the searched keyword(s). I want to take it a step further and highlight the keywords when the content is displayed. I created a "highlight" class that changes the background color to make the word(s) stand out, but my stript is giving me an error.
$in = preg_replace($ckeyword, "<span class='highlight'>".$ckeyword."</span>", $in);
I get the error: "Warning, Empty regular expression"
Any ideas what i'm doing wrong?
The $in variable has already been formatted from the raw database data to remove additional whitespace, and convert addresses to links.