* saralk waits for someone to point out a really obvious mistake
code:
$terms = array();
$terms = explode(" ", $search);
foreach ($terms as $value) {
$text = str_replace($value, "<span style='background-color:#FFFF00'>$value</span>", $row["Text"]);
}
echo $text;
When I run that code, it only highlights the last word in the array, and not the ones before it.
Any Ideas?