term highlight algorithm (HTML)

latuya

New Member
I know there are quite some term highlighting questions asked but as far as I know none answers mine. The search terms are put into an array\[code\]$keyarray = array("DE", "ABCD");$string = "ABCDEF";foreach ($keyarray as $value) { $string = str_ireplace($value, "<b>{$value}</b>", $string);}\[/code\]The results will obviously be ABCDEF rather than ABCDEFSo its there anyway way that I can highlight both terms using a BOLD tag extremely fast using PHP?
 
Back
Top