ted_chou12 Posted April 10, 2007 Share Posted April 10, 2007 I want to remove the text using ereg_replace or something like that in the <> characters so all the html codes within the texts are gone, such that: text <b>is</b> bold. This is a <a href="link.php">link</a>. becomes: text is bold. This is a link. Thanks Ted. Quote Link to comment Share on other sites More sharing options...
Wildbug Posted April 10, 2007 Share Posted April 10, 2007 Have you tried this yourself yet? It's an easy one. $text = preg_replace('/<.*?>/','',$text); < is a literal opening angle bracket. . means ANY character * means zero or more of the previous character ? means "don't be greedy about that, though" > is a literal closing angle bracket (I'm not entirely familiar with the POSIX regular expression syntax, so I gave you the preg one.) Quote Link to comment Share on other sites More sharing options...
effigy Posted April 10, 2007 Share Posted April 10, 2007 Use strip_tags. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted April 10, 2007 Author Share Posted April 10, 2007 yeah, thanks, Wildbug and effigy, and found strip_tags(). Ted Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.