1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Automatically inserting tags into php?

Discussion in 'PHP' started by lorien1973, Apr 20, 2005.

  1. #1
    I want to automatically hyperlink text on a page that has an http:// in front of it. The pages are all coded in PHP. Is there a simple way to do it?
     
    lorien1973, Apr 20, 2005 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1) Find start position of the url.
    2) Find end position of the url.
    3) Make this bit a sub-string.
    4) Prefix substring with <a href="
    5) Enter sub_string.
    6) Suffix with " target="_new">
    7) Enter sub_string.
    8) Suffix with </a>

    Restart from 1 but start the needle search from the end position of the previous url.

    Keep looping until FALSE.
     
    T0PS3O, Apr 20, 2005 IP