function highlight(needle, haystack) {
var re = new RegExp(needle, 'gi');
return haystack.replace(re, function(str) {return '<span style="background:yellow">'+str+'</span>'});
}
function highlight(needle, obj) {
var re = new RegExp(needle, 'gi');
obj.innerHTML = obj.innerHTML.replace(re, function(str) {return '<span style="background:yellow">'+str+'</span>'});
}
function highlight($needle, $haystack, $background_color='yellow') {
if($needle == '') return $haystack;
return preg_replace( '#' . preg_quote($needle,'#') . '#iu',
'<span style="background:'.$background_color.'">$0</span>',
$haystack );
}