Erregi_replace removing html

They have: 141 posts

Joined: Aug 1999

Hello, I was wondering if anyone knew off hand how to remove html from a posting using PHP. I tried

$content = eregi_replace("<(.*)>"," ",$content);

but that removes anything everything in the best if it for example started with a <b> and ended with a </b> any ideas how to remove only the tags?

Thanks

------------------
[url=http://dlo.net[/url]
We know Have Game Reviews

They have: 5,633 posts

Joined: Jan 1970

Hi Randall,

This may be what you are looking for:

http://www.php.net/manual/function.strip-tags.php

It pretty much does what you want - there is also some user contributed notes for alternate methods... You should be able to find what you need there though.

------------------
TWF Administrator

Dynamic Internet Solutions : Windows NT and UNIX Hosting & Dedicated Servers

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.