Re: [PHP] Battling with highlighting search criteria

2002-11-04 Thread Justin French
how are you doing it for only the FIRST??? Anyhoo, a simple string replace should do it... I'd do this: $result = str_replace($search,span class=\highlight\{$search}/span,$result); Justin on 04/11/02 6:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hi there, My brain has just gone very

RE: [PHP] Battling with highlighting search criteria

2002-11-04 Thread David Russell
-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need a regexp

Re: [PHP] Battling with highlighting search criteria

2002-11-04 Thread Justin French
[mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need a regexp... $result = eregi_replace($search,span class=\foo\$search/span,$result); This will be a little slower that str_replace

Re: [PHP] Battling with highlighting search criteria -solution

2002-11-04 Thread Justin French
-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need

Re: [PHP] Battling with highlighting search criteria

2002-11-04 Thread rija
$result = eregi_replace(($search),span class=hightlight\\0/span,$result) ; I use it, and I work fine for me. - Original Message - From: David Russell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 7:27 PM Subject: [PHP] Battling with highlighting search criteria

Re: [PHP] Battling with highlighting search criteria

2002-11-04 Thread Michael Sims
On Mon, 4 Nov 2002 11:59:20 +0200, you wrote: Ok, this works. Just one more thing, How can I get the return in the same case as it was originally? Use backreferences to capture what matched and use that in the replace string. Example: ? $search = is; $str = This is a test, isn't it?; $str =