(Or looking for highlighting PHP code itself?)
htmlspecialchars()This text has some <b>strong</b> words in it..
Luckily, <strong><b>strong</b></strong> elements are not converted into <b>strong</b> things as well.
Even if you have <a rel="strong">attributes</a> it does not matter.. Yay!
Erm, yeah, you know what I mean. The force is <b>strong</b> in this one!
This text has some strong words in it..
Luckily, strong elements are not converted into strong things as well.
Even if you have attributes it does not matter.. Yay!
Erm, yeah, you know what I mean. The force is strong in this one!
$output = preg_replace(
"/(>|^)([^<]+)(?=<|$)/esx",
"'\\1' . str_replace('" . $keyword . "', '<b>" . $keyword . "</b>', '\\2')",
$input
);