Reply to search and replacing but keeping the letter case in tact

Your name:

Reply:


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, -

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация