Welcome Guest, Not a member yet? Register   Sign In
highlight searched string
#9

[eluser]John_Betong[/eluser]
Why not use CodeIgniter's Text helper?

Code:
highlight_phrase()

Will highlight a phrase within a text string. The first parameter will contain the
original string, the second will contain the phrase you wish to highlight. The third and
fourth parameters will contain the opening/closing HTML tags you would like the phrase
wrapped in. Example:

$str = "Here is a nice text string about nothing in particular.";

$string = highlight_phrase($string, "nice text", '<span style="color:#990000">', '</span>');
The above text returns:

Here is a nice text string about nothing in particular.


Messages In This Thread
highlight searched string - by El Forum - 10-23-2007, 11:03 PM
highlight searched string - by El Forum - 10-24-2007, 12:22 AM
highlight searched string - by El Forum - 10-24-2007, 12:30 AM
highlight searched string - by El Forum - 10-24-2007, 02:06 AM
highlight searched string - by El Forum - 10-24-2007, 05:04 AM
highlight searched string - by El Forum - 10-24-2007, 06:20 AM
highlight searched string - by El Forum - 10-24-2007, 06:25 AM
highlight searched string - by El Forum - 10-24-2007, 06:28 AM
highlight searched string - by El Forum - 10-24-2007, 06:49 AM
highlight searched string - by El Forum - 10-24-2007, 07:02 AM
highlight searched string - by El Forum - 04-12-2008, 09:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB