hilight substring
Posted: Tue Oct 14, 2003 4:24 am
Hello all,
I have this code
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!
any ideas?
I have this code
Code: Select all
<?php
$string='<This is my string>';
$sub="is";
$hilighted=str_replace($sub,"<font color=yellow>$sub</font>",$string);
echo htmlentities($hilighted);
?>I need to show the <> and to prevent the browser to process it like html tag!
any ideas?