a remove attribute function
Moderator: General Moderators
a remove attribute function
Hi, I'm usign strip_tags() to remove unwanted tags in some code I have but I would also like to remove unwanted tags in tags I want to keep.. eg '<a href='link.html' target='_blank'>link</a>' --- is there a function to remove the target attribute or do i need to do a search and replce sorta thing?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
yep, thanks got it to work..
this is what i used:
lots of escape characters.. it was returning ALIGN=\\\"LEFT\\\" so yeah.. wanted to remove that.
this is what i used:
Code: Select all
<?php
$content = str_replace(' ALIGN=\\\"LEFT\\\"',"",$content);
?>lots of escape characters.. it was returning ALIGN=\\\"LEFT\\\" so yeah.. wanted to remove that.