|
Posted by laredotornado@zipmail.com on 06/08/06 18:49
Hello,
Using PHP 4, how would I do the following? I want to do a case
insensitive search on a string and replace it with "<span>" tags
opening and following the string in question. However, when I replace
the string, I want to preserve whatever the case was before. So, for
example, given
$search_str = "abc";
$main_str = "ABCDE"
$new_str = highlightSearch($main_str);
I would like "$new_str" to contain "<span
class='highlight'>ABC</span>DE".
Does that make sense? Any ideas?
Thanks, -
Navigation:
[Reply to this message]
|