wannabcoder
wannabcoder

Reputation:

How to get rid of HTML tags

I am a little stuck and need help. So it goes like this. I have a site where the count of comments on a particular article comes from comment module. the HTML tag on it is displayed which looks something this (<em>1</em>). I have recently upgraded my site 5 to 6. Everything else works fine apart from this. Please Help.

Thanks!!!

Upvotes: 0

Views: 1373

Answers (2)

451F
451F

Reputation: 281

You can use strip_tags() function to remove HTML from string

Upvotes: 1

torger
torger

Reputation: 2328

Assuming you want to get rid of <em>1</em>: \<em([^>]*)\>(\d[^>]*)\</(em[^>]*)\> -> removes all bracketed text, containing numbers.

And if this is clumsy, shh, I only learnt regexes yesterday.

Upvotes: 0

Related Questions