I want to make a function to highlight certain words in a text. I am unsure the most efficient way to replace "Word" and "word" to be highlighted. Is there a way to make str_replace do something like
str_replace(("Word" || "word"), "Highlighted Word", $text);
I'm doing this right now:
$search_string = substr($glos['word'], 0, 1);
$search_string = "([".strtolower($search_string).strtoupper($search_string)."])";
$search_string = $search_string.substr($glos['word'], 1);
$text = ereg_replace($search_string, "[\\0]", $text);