Hi,

I am looking for a pattern/function which can be used to insert a background color for a word in a string.

I want to use this for a keyword search application where the words entered are highlighted in the results display. If I do a direct replace the case of the text in the string cannot be maintained.

For eg:
$string = "PHP core developers & Php Programmers."
$result = "<span style='background:#DDDDDD'>PHP</span> core developers & <span style='background:#DDDDDD'>Php</span> Programmers."



Sheni R Meledath
[EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to