Remove hyperlinks ( A tags ) from HTML

Discussion in 'PHP' started by sexymassage, Mar 13, 2008.

  1. #1
    how to use php to Remove hyperlinks ( A tags ) from HTML pages?
     
    sexymassage, Mar 13, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    hihihi.. put it inside echo.. or inside a variable
     
    bartolay13, Mar 14, 2008 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    ^ ... the hell are you talking about? Hihihi...?

    And what exactly do you want to do? Replace the <a> tags with the text of the link? (What's between the <a> </a> tags)... or do you just want to remove it all?
     
    nico_swd, Mar 14, 2008 IP
  4. sexymassage

    sexymassage Guest

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    for example,
    <a href=http://www.domain.com>good domain</a>
    Code (markup):

    i want to remove
    <a href=http://www.domain.com>
    PHP:
    and
    </a>
    PHP:
    , just keep the test:
    good domain
     
    sexymassage, Mar 14, 2008 IP
  5. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can use strip_tags function.

    <?php
    
    $text = '<p>Test paragraph.</p>';
    echo strip_tags($text); 
    
    ?>
    PHP:
    This will output:

    Test paragraph.
    Code (markup):
     
    Dondon2d, Mar 14, 2008 IP
  6. jackieshine

    jackieshine Banned

    Messages:
    242
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks, thats what i need.
     
    jackieshine, Mar 18, 2008 IP