htmlentities extended?? any function which excludes some tags??

Discussion in 'PHP' started by LOD, Oct 23, 2009.

  1. #1
    hi guys
    i want my visitor to be able to put <a> tag in their comment and no other html tags.. now i'm using htmlentities which is removing all the HTML tags.. now i want to know whether there is any function which will work as htmlentities but will take some tags as parameters to make exception for those tags...
     
    LOD, Oct 23, 2009 IP
  2. heavydev

    heavydev Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    take a look at the strip_tags function. i believe that one allows for exceptions.
     
    heavydev, Oct 23, 2009 IP
  3. Nei

    Nei Well-Known Member

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    170
    #3
    $str=strip_tags($str, '<a>');
     
    Nei, Oct 23, 2009 IP