Featured Post

So what do those under-age drinkers drink?

The Echo last week ran with a story about the Police confiscating alcohol from under-age drinkers. They published a table of what was taken and had a picture of the haul. Now was it like what the Tories were saying? That the problem is with alcopops and super-strength booze? Nope, here are the figures: Beer...

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