[email protected]
New member
Hi,
I'm currently working on a little PHP search box that is linked to a MYSQL Database and everything works fine. However, much like Google, I would like to embolden the keywords which are entered when a person searches.
Example:
$description = ereg_replace($search_each, '<b>'.$search_each.'</b>', $description);
The code above works, but only if the case is exactly the same...example. If I search 'google' then all the lowercase googles get emboldened but not the uppercase ones. I'm aware I need some sort of LIKE statement so that it emboldens the keywords regardless of case.
(I can add more code if it is needed)
Thanks for the help
Thanks Colanth. Worked Like a Charm. However, when using that method, if anything is capitalized, it becomes lower case. Any way around that?
I'm currently working on a little PHP search box that is linked to a MYSQL Database and everything works fine. However, much like Google, I would like to embolden the keywords which are entered when a person searches.
Example:
$description = ereg_replace($search_each, '<b>'.$search_each.'</b>', $description);
The code above works, but only if the case is exactly the same...example. If I search 'google' then all the lowercase googles get emboldened but not the uppercase ones. I'm aware I need some sort of LIKE statement so that it emboldens the keywords regardless of case.
(I can add more code if it is needed)
Thanks for the help
Thanks Colanth. Worked Like a Charm. However, when using that method, if anything is capitalized, it becomes lower case. Any way around that?