php - How to remove only html tags in a string? -


I've written the code to delete the HTML tag, but this a < B also removing the type wire. I'll call it 2 & lt; 3 or a < B such as strings.

  $ term = "a & lt; b"; Echo "text --- ---". Preg_replace ('/ (?: & Lt; | & amp; lt;).? (?: & Gt; | & amp; gt;) /', '', $ word);   

How can I remove html tags in a string without removing LT or GT?

Comments