Simple text highlighter on PHP, useful to mark search results.
$search = $_GET["search"]; //exists check ommited
$text = "Content in which to search here";
//i modifier to ignore case, u for utf-8 (cyrillic supported)
$search ? preg_replace("/".($search)."/iu", '<i>\0</i>' , $text) : $text;