I have enclosed the simple PHP function for Text [array] Highlight without changing the own case...
PHP Code:
function ShowPowerHighlight($Text,$Needle) {
for($j=0; $j< count($Needle); $j++){
if ($Needle[$j] != "") {
$TextTemp = "";
$i=0;
while($i if((($i + strlen($Needle[$j])) <= strlen($Text)) && (strcasecmp($Needle[$j], substr($Text, $i, strlen($Needle[$j]))) == 0)) {
$TextTemp .= '' . substr($Text, $i , strlen($Needle[$j])) . '';
$i += strlen($Needle[$j]);
}else {
$TextTemp .= $Text{$i};
$i++;
}
}
$Text = $TextTemp;
$TextTemp="";
}
}
return $Text;
}
$Text= "The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases" ;
$Needle= array ("0" =>"PHP","1"=>"web","2"=>"to","3"=>"byet");
echo ShowPowerHighlight($Text,$Needle);