Parse <everything in here> from a string...

Discussion in 'PHP' started by robster, Feb 21, 2007.

  1. #1
    Looking to parse all tags out of a string...

    $string = "<img src="location.jgp"> Look at this image <a href="somepage">Link here</a>";

    $string = noTags($string);

    Can someone write this function?
     
    robster, Feb 21, 2007 IP
  2. robster

    robster Peon

    Messages:
    94
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Output would be " Look at this image Link here"

    Thanks!!
     
    robster, Feb 21, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  4. robster

    robster Peon

    Messages:
    94
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ah ... perfect .. stupid me ...

    However, what if the problem string is showing up as &lt;img src= ... &gt

    ?? Thats why my very tedious script wasnt working before, come to find out, and strip_tags() doesnt work with this either.

    Thanks!
     
    robster, Feb 21, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375