Hi all,
I'm trying to make a little search using REGEX.
My code is as follow:
$pattern = "/(" . $dHighlight . ")/";
$replace = "<span class=\"coolio\">$dHighlight</span>";
$daOutput = preg_replace($pattern, $replace, $daOutput);
Where $dHighlight is simply what I sent from a INPUT TEXTBOX...
Now the problem is this, let's say I search for HELL in my string. It will not only match HELL but HELLO and SHELL also. However, I just want to replace words that is exactly HELL. So what can I do to fix this?
Thanks