nada no funciono
tambien tengo esta funcion
Código PHP:
<?
function highlight_search($search_words,$string,$bgcolors='yellow')
{
if (is_array($bgcolors)) {
$no_colors=count($bgcolors);
} else {
$temp=$bgcolors;
unset($bgcolors);
$bgcolors[0]=$temp;
$no_colors=1;
}
$word_no=0;
foreach($search_words as $search_word)
{
$regex1 = ">[^<]*(";
$regex2 = ")[^<]*<";
preg_match_all("/".$regex1.$search_word.$regex2."/i", $string, $matches, PREG_PATTERN_ORDER);
foreach($matches[0] as $match)
{
preg_match("/$search_word/i", $match, $out);
$case_sensitive_search_word = $out[0];
$newtext = str_replace($case_sensitive_search_word,"<span style=\"background-color: ".$bgcolors[($word_no % $no_colors)].";\">$case_sensitive_search_word</span>", $match);
$string = str_replace($match, $newtext, $string);
}
$word_no++;
}
return $string;
}
?>
esta hace eso bien pero no me reconoce los acentos y tal como por ejemplo paises cuando pongo países y vicerversa
Gracias
Un Saludo