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.

Help With Function

Discussion in 'PHP' started by adamjblakey, Dec 2, 2008.

  1. #1
    Hi,
    SEMrush
    I have several rows in a database which has just text and images in. What i want to do is when printing out i want to find anything that looks like this:

    <img alt=Kitchen src=http://davidjohninteriors.co.uk/uploads/images/thumbs/83317967.JPG align=left>
    Code (markup):
    And replace it with:

    <a href=uploads/images/big/83317967.JPG ><img alt=Kitchen src=uploads/images/thumbs/83317967.JPG align=left></a>
    Code (markup):
    The only problem is that the alt is going to be different on each of them also the align and name of the image.

    How would i go about doing this?

    Cheers,
    Adam
     
    adamjblakey, Dec 2, 2008 IP
    SEMrush
  2. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #2
    can you explain your text and your image text on your database (before print out).
     
    misbah, Dec 2, 2008 IP
  3. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yea post the actual code that loads the images etc.. (PHP CODE)
     
    atlantaazfinest, Dec 2, 2008 IP
  4. rkharikrishnan

    rkharikrishnan Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i think you may need to do a loop and print the html tags combining with the values from db if the db is stored with image paths and name.

    Do make your requirements clear
     
    rkharikrishnan, Dec 3, 2008 IP