Removing html tags but not all
Posted: Fri Nov 16, 2007 6:02 am
Hi,
I need to remove some html tags and can successfully do this with the code below.
However I want to be able to leave in some html tags for example I like to be able to leave this in the code below <table><tr> <td? Hi there </td> </tr> </table> while removing the <span> tags etc.
Can this be done?
Thanks for any help
B
I need to remove some html tags and can successfully do this with the code below.
Code: Select all
<?PHP $cleaned_up = trim(strip_tags('<span> Hi there </span>'));
echo $cleaned_up ?>Code: Select all
<?PHP $cleaned_up = trim(strip_tags('<span> <table><tr> <td? Hi there </td> </tr> </table></span>'));
echo $cleaned_up ?>Thanks for any help
B