Find a string and highlight it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Austin Varghese
    New Member
    • Nov 2006
    • 1

    Find a string and highlight it

    How can i find a string from a file and hilight it?
    somebody pls help me
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Use an expression and enclose the to-be-highlighted text within <span> tags (makes it red here):
    Code:
    $input_txt = eregi_replace($word_to_higlight, '<span style="color:red;">' . $word_to_highlight . '</span>', $input_txt);
    Ronald :cool:

    Comment

    • bishwadeep
      New Member
      • Nov 2006
      • 12

      #3

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        bishwadeep: may I remind you that this is a PHP forum, not a JS one!

        Ronald :cool:

        Comment

        Working...