Código PHP:
Ver original<?php
function tagHighlight($text, $word, $tag = "strong") {
$iPos = -1;
while(($iPos = stripos($text, $word, $iPos + 1)) !== false) { $iPos += $srLen + $ohLen;
}
return $text;
}
$text = "Hola, Esto es una prueba, y esTo tambien, osea que todo esto, solo sirve para probar a ESTO.";
$word = "esto";
echo tagHighlight($text, $word);