need some help

Discussion in 'PHP' started by johny321, May 17, 2010.

  1. #1
    Hi, I have a search function that show me search code & also URL.

    suppose i have a table abc & three fileds code name URL. I search for code from text box in my form.

    that show result
    code Name
    1 yahoo

    but i want to have hyper link with searched keywords. & require folllowing result instead of above results

    code Name
    1 yahoo



    can any one explain it. I am really much needed this solution

    Thanks
     
    johny321, May 17, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Can you say in detail
    If it also shows url
    The
    here it will
     
    roopajyothi, May 17, 2010 IP
  3. abstractworld

    abstractworld Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    2 Steps: get the URL and convert the keyword to its <a href ... and then use str_replace to replace the keyword with the href.
    e.g.
    $atag = '<a href="'.$url.'">'.$keyword.'</a>;
    $finaltext = str_replace($keyword, $atag, $text);
     
    abstractworld, May 17, 2010 IP