<p>I am using tinyMCE as my text editor on my site and i want to reformat the text before saving it to my database (changing the &amp;rsquo; tags into ' then in to &amp;#39;). I cannot find a simple way of doing this using tinyMCe and using htmlentities() changes everything including &lt;>. Any ideas?</p>

You can user
```
strip_tags($str, $allowed_tags)
```
like below:
```
```
$txt = strip_tags($txt, '<p><a><br>');
```
```