PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$string='<This is my string>';
$sub="is";
$hilighted=str_replace($sub,"<font color=yellow>$sub</font>",$string);
echo htmlentities($hilighted);
?>
Because my string is between <> I can't seem to hilight the substring because I need to use htmlentities!
I need to show the <> and to prevent the browser to process it like html tag!