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='highligh t'>ABC</span>DE".
Does that make sense? Any ideas?
Thanks, -
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='highligh t'>ABC</span>DE".
Does that make sense? Any ideas?
Thanks, -
Comment