Featured Post

Phone Mast applications

When I was a councillor on Lincoln City a total of three applications for phone masts came in front of the Planning Committee. Due to a prejudicial interest I never took part in the discussion however I was pleased to see that the councillors understood the laws around the applications. Two of the applications...

Read More

PHP Question – Removing tags and content

Posted by Ryan Cullen | Posted in LibDemBlogs | Posted on 23rd July 2007

0

This is mainly out there to those who code in php.
At the moment LibDemBlogs, strips out all formatting from blog posts, mainly to ensure that cut-off <b> tags don’t end up bolding everything, but also it puts each post on a equal platform.
However over time I’ve noticed an increase use in the <strike> tag. This tag strikes through text and is normally used to later correct a mistake, or imply someone might not be telling the truth. But as LDBlogs removes the formatting, it makes for an odd read.
So I’m trying to completly remove everything between the tags, Google and even myself believe that this should work
$post = preg_replace('/<strike>([^>]*)<\/strike>/i', '', $post);
However LDBlogs is still showing the deleted text. Any other ideas?

Fixed! The code was working, just happened that the bit of the WordPress RSS feeds I was reading had already removed the tags and other stuff, reading the <content:encoded> gives me the original text.


Write a comment

Do you agree to the T&Cs?